
August 10th, 2000, 03:06 AM
|
|
Contributing User
|
|
Join Date: May 2000
Location: Alkmaar, The Netherlands
Posts: 123
Time spent in forums: < 1 sec
Reputation Power: 9
|
|
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>I want (1) to expire when the user exit the browser, and (2) to last permanently.[/quote]
You can do this in both ways. However you can do it best with setting 2 cookies. One with no expiration date so it will end at the browser session, and two with expiration date 5 years from now or something.
The other solution would be to have the one cookie while a person is visiting your site. As this person leaves remove the temporary data from the cookie and only keep the permanent data.
I would suggest setting 2 cookies by:
document.cookie = "name=value; expires=someTime;";
where someTime is build like this:
Wdy, DD-Mon-YY HH:MM:SS GMT e.g. Mon 14-Aug-00 12:00:00 GMT.
------------------
Good luck,
Bas
------------------
E-mail me at: b.vandermeijden@pecoma.nl
|