-
Use nng_http_res_add_header to set multiple "Set-cookie" protocol headers, which will merge multiple cookies into a single "Set-Cookie" protocol header, so that the browser can only parse a single cookie, not multiple cookies. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Give examples: #include <nng/nng.h> void set_response_cookies(nng_http_res* response) { The response header we expect to get looks like this:----- Instead, you now get a response header formatted like this:---- |
Beta Was this translation helpful? Give feedback.
-
In fact, according to the HTTP 1/1 specification, the combining that is done is legal and expected. See RFC 2616 4.2, which says:
If your browser does not understand the combination of the headers, then it's a bug in the browser. I'm not aware of any that suffer from this defect. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
In fact, according to the HTTP 1/1 specification, the combining that is done is legal and expected. See RFC 2616 4.2, which says: