Closed akh9804 closed 4 months ago
What is the use case for this? Can you show a code example where it would be useful?
Yes. I wanted to set expires as long as I can. So, I set it as a very large number.
Cookies.set('name', 'value', { expires: 100000000000 });
I expected cookies wouldn't expire almost forever but it did in short time.
It'd be very useful when you want cookies not to expire for a long time.
Why not set expires
to a less insanely large number? E.g. even if you just set it to 100_000
that would be enough for the cookie to not expire for hundreds of years.
You're right. But I didn't know until I looked into source code that the error was due to the large value I put in. I think this one is necessary to prevent this situation.
Expires
should work even when it is above the maximum date