Quick Cookie Question
| From: | PHP List | Date: | Mon, 21 Oct 2002 18:40:09 +0000 |
| Subject: | Quick Cookie Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120789@lists.php.net to get a copy of this message | ||
Hi,
Lets say I set a cookie like this:
setcookie(session_name(), $szSessionID, time()+$expireTime, "/");
The cookie does get set fine.
Now, how can I change the cookie value $szSessionID without affecting the cookies expire time?
Will $_COOKIE['szSessionID'] = $newsessionid store the new value to the cookie?
So if the cookie time was set to expire in 7 days, I would like to be able to change the cookies
value 3 days later, but the expire time would not be reset to 7 days, it would still have the
original time which would mean 4 days left to the cookie life. If I can retreive the current expire
time of the cookie, I could just subtract that value, but I don't know how to get the cookies
set expire time. And I don't want to store the expire time as another cookie or part of this
cookie.
Thanks for any help.
Chris