0

How do browsers act when the HTTP response contains two Set-cookie headers, and only expires and Max-Age are different between the two (same name, value, domain and path etc..)?

I need to extend session lifetime. The system calls setcookie with the cookie name session_name(), with a period I want to extend.

I cannot change that value in the code directly, but I can call setcookie afterwords with the my customized period. This causes the Set-Cookie header to be sent twice, with my modified period comes next (because I called setcookie after it was called)

In Chrome, it handled it by overriding, so the second one override the first and that is what I need.

However, I do suspect this will happen with every browser or if this is a standard behavior. Is it?

doc_id
  • 1,363
  • 13
  • 41
  • possible duplicate of [Multiple Set-cookie headers in HTTP](http://stackoverflow.com/questions/3806132/multiple-set-cookie-headers-in-http) – doc_id Mar 26 '15 at 20:49
  • DUPLICATE http://stackoverflow.com/questions/3806132/multiple-set-cookie-headers-in-http The answer is Yes it takes the latest. – doc_id Mar 26 '15 at 20:51

0 Answers0