browser - Multiple Set-cookie headers in HTTP -


I am writing a small class that acts as a very basic HTTP client, as part of a project I am working on this, I am making it a cookie aware, however, it is not clear to me that what happens to my client when they receive many "set-cookie" headers with the same key but different values ​​are set .

For example,

  set-cookie: PHPSESSID = ABC; Path = / set-cookie: PHPSESSID = def; Path = / set-cookie: PHPSESSID = ghi; Path = /  

Is one of these considered a value for PHPSESSID? This is usually happening on the same page when calling session_start () and then session_regenerate_id (). Each will set their own header, it looks fine from all browsers, but I think my client can not get a chance to choose the right one.

Any thoughts ?!

:

If the user agent has the same cookie-name , The domain-value, and route-value are in the form of a cookie that has already been archived,
Existing cookies have been ejected and replaced with a new cookie has been changed.
Notice that the user can delete the user agent by sending a cookie with a new cookie. In the past, the time of attribute is eliminated with values.

So I will process the orders given at the top and overwrite them if there is a duplicate. So in your case you only have one PHPSESSID = gh.


Comments