D.Slatk Posted March 22, 2005 Posted March 22, 2005 Okay, I've got most of the cookies down, the only thing I am left wondering at is how to set an infinite expiration date. Is it possible, or not? If not I think I could use an if statement to rest the cookie's current time back to whenever, or add onto the cookies current time. But I really hope that isn't necessary... What I'm trying to do is let viewers set the skin of a site (the site isn't up yet anyways so I'm on no rush). I have it in PHP, and it sets a cookie called colorTheme, and its value determines which CSS file the browser is going to use. But I need to know how to make it so it'll never expire uintil they delete it or until they click the default color scheme. Quote
TCH-Bruce Posted March 22, 2005 Posted March 22, 2005 Can't you set the date for several years in the future? Quote
borfast Posted March 23, 2005 Posted March 23, 2005 If I recall correctly, there's no way to set the cookies not to expire. What you can do is, like Bruce said, set the date for several years in the future. Quote
D.Slatk Posted March 23, 2005 Author Posted March 23, 2005 Darn...I was hoping that there was a set way in order to do it (rather than having it expire in the great future). Thanks anyways. Quote
borfast Posted March 23, 2005 Posted March 23, 2005 Slatck, but why do you need to set it to infinite? Won't an expire date in, say, 100 years do? Quote
Guest helpbytes Posted March 23, 2005 Posted March 23, 2005 Yeah the practice is to set a cookie way into the future, and to expire it again, to set it in the past (maybe due to peoples clocks being possibly wrong I dont know, but some, such as Yahoo!, set expiring cookies several years into the past). It's worth remembering too, setting it 10 years into the future is no problem, what is the chance they're using the same computer, same browser, or haven't cleared their cookies in 10 years:o Quote
TCH-Don Posted March 23, 2005 Posted March 23, 2005 I think the rule is to set to your birth year plus 200 then you shouldn't have to worry about it Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.