Click to See Complete Forum and Search --> : setCookie Expires Never
TheGoldenShogun
Jun 25th, 2002, 09:41 AM
this is probably an easy one. How do I set a cookie that never expires. Say I have a customer order something and then the next time (maybe a month or so down the road) they come back to my site. I want to have their name, address, city, state, zip, email remembered so that I they dont have to keep filling it out. And maybe even put a thing on the anchor page saying Welcome $yourName!..
cpradio
Jun 25th, 2002, 10:51 AM
you can't. You can set it to expire in a year, or 10 years even and when they come back you can reset it, but there is no way to stop it from expiring. Also note that the user has the option to clear his/her cookies too.
-Matt
The Hobo
Jun 25th, 2002, 11:21 AM
I always set them for a year and then just have 'em reset everytime the user comes to the page.
TheGoldenShogun
Jun 25th, 2002, 11:27 AM
oh ok, I know how to set the time on it but I thought that you could make it so that it doesn't expire. And if they delete their cookies, I can't really do anything so I'm cool with that. I'll just run with it set to a year, like The Hobo said.
Thanks all.
Iamryan2002
Jul 1st, 2002, 10:19 PM
one thing, use sessions:
Sessions are stored on the server, not the client... they dont expire.. and they are easy to use
The Hobo
Jul 1st, 2002, 11:07 PM
Originally posted by Iamryan2002
one thing, use sessions:
Sessions are stored on the server, not the client... they dont expire.. and they are easy to use
Hi. Again, sessions use cookies.
The Hobo
Jul 1st, 2002, 11:08 PM
A visitor accessing your web site is assigned an unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.
Of course you can store it in the URL, but once they close the window, it's gone. Next time they come back, they're assigned a new session ID.
cpradio
Jul 2nd, 2002, 05:28 AM
Originally posted by Iamryan2002
one thing, use sessions:
Sessions are stored on the server, not the client... they dont expire.. and they are easy to use
Far from it. Sessions expire the second the user closes his/her browser window.
*My computer was having a fit this morning by hiding most of the posts throughout various forums so sorry for repeating what The Hobo said*
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.