You could set the expiry date to ten years in the future but what if the user deletes all their cookies for some reason?
In practice the answer is, "not in any way you can count on".
| [reply] |
I don't think so, I don't think the cookie header command set includes that option — though you can set the expires field a very long time into the future. (Pass a formatted date instead of an maximum age, it'll just use it.)
Why do you want it, anyway? Do you expect people to still be using the same computer and browser, in 10 years time? Do you still expect to recognize them when they come back for the first time, after your cookie has expired, years from now? Does it even matter?
For people that frequent your site often enough, I'd simply refresh the cookie once in a while. That way, for regular visitors, the cookie will effectively never expire. | [reply] |
Set expire to a high value
...
-expires => '+99y',
...
| [reply] [d/l] |