Sergej Andrejev Sergej Andrejev - 28 days ago 12
HTTP Question

Can a cookie expire when EITHER some time passes OR browser is closed?

I know that I can set expiration date for a cookie, but can I make a cookie expire after some time OR when browser is closed?

Answer

If you set an expiration date, this will set them to expire on that date, whether the browser is open or closed.

Only non persisted cookies will expire once the browser is closed.

See cookie expiration rules on wikipedia.

Comments