Page 1 of 1
But I don't WANT my cookie to expire!
Posted: Mon Oct 10, 2005 8:24 pm
by VKX
Is there a way I can make my cookie never expire? If not, what's the maximum duration I can set it for?
Here's my current cookie:
Code: Select all
setcookie("skin", $_POST[SKIN], time()+3600*24*30, "/", ".awesomestart.com");
Posted: Mon Oct 10, 2005 8:28 pm
by Nathaniel
Um. 9999999999999999999999999^99999999999999999 I guess.
It's bad netiquette to have a never-expiring cookie, though. I'd say 6 months would be stretching it, even 3 would be up there unless you had a really good reason to store it that long. And remember that many people routinely delete all of their cookies.
Posted: Mon Oct 10, 2005 8:45 pm
by VKX
What if I did . . .
Code: Select all
setcookie("skin", $_POST[SKIN], time()+3600*24*30*12, "/", ".awesomestart.com");
That would make it last about a year, right?
I do have a pretty good reason for the cookie . . .
http://www.awesomestart.com
Posted: Mon Oct 10, 2005 9:00 pm
by Nathaniel
Ah, that IS a good reason.
And yes, that should make it last a year.
Posted: Mon Oct 10, 2005 9:13 pm
by feyd
yeah.. it's recommended to only set a cookie for a year ahead at most.