add_header Set-Cookie The difference between Max-Age and Expires

c0nw0nk nginx-forum at
Fri Sep 9 07:01:39 UTC 2016

So i read that IE8 and older browsers do not support "Max-Age" inside of
set-cookie headers. (but all browsers and modern support expires)

add_header Set-Cookie
"value=1;;Path=/;Max-Age=2592000"; #+1 month 30

Apprently they support "expires" though so i changed the above to the
following but now the cookie says it will expire at end of every session.

add_header Set-Cookie
"value=1;;Path=/;expires=2592000"; #+1 month 30

how can i tell this to expire 1 month into the future all the examples i
find mean i have to set a date manually what would mean restarting and
editing my config constantly. (automated would be nice)

Posted at Nginx Forum:,269438,269438#msg-269438

More information about the nginx mailing list