Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a cookie with 1969 as the expiration date mean?

Tags:

enter image description here

How can a cookie expire in 1969?

What does this mean?

Thanks,

like image 469
AGamePlayer Avatar asked Jul 24 '18 11:07

AGamePlayer


People also ask

How long can you eat a cookie after expiration date?

But as long as it doesn't smell funky (the oils in the cookie may go bad over a long period of time) and it doesn't crumble apart in your hand, then it's okay to eat.

What does expiration date mean on cookies?

WHAT IS A COOKIE? A cookie is a small snippet of text that a website asks your browser to store. All cookies have expiration dates in them that determine how long they stay in your browser. Cookies can be removed in two ways: automatically, when they expire, or when you manually delete them.

How do I check my cookies expiry date?

If you are using Chrome you can goto the "Resources" tab and find the item "Cookies" in the left sidebar. From there select the domain you are checking the set cookie for and it will give you a list of cookies associated with that domain, along with their expiration date.

Which cookie has an expiration date?

Persistent cookie Persistent cookies are not deleted by the browser when the user closes it. These cookies have an expiration date that you can set in your server.


1 Answers

Unix time was started at the beginning of 1970, that means that -1 is in 1969. And that is a commonly used value for "unknown" if the expected value is usually positive. And for cookies MaxAge with a negative value means that the cookie expires as soon as the browser gets closed:

Relevant section of the spec:

5.2.2 [..] If delta-seconds is less than or equal to zero (0), let expiry-time be the earliest representable date and time. Otherwise, let the expiry-time be the current date and time plus delta-seconds seconds.

like image 200
Jonas Wilms Avatar answered Dec 23 '22 08:12

Jonas Wilms