I'm setting a cookie expiration (using Express) to a current date. But upon inspection in Chrome, the date is 1969-12-31T23:59:59.000Z
.
In Firefox the Cookie's expiration date value is session
.
Why is my cookie being set to this date? I'm thinking it is a bug, because Chrome is still sending the cookie, meaning it ACTUALLY ISN'T expired.
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 is not stored persistently and will be deleted when the Web browser exits.
source: https://stackoverflow.com/a/51497662/3892213
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With