Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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. :D

Guest helpbytes
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...