This is a discussion on Really stupid cookie question within the PHP General forums, part of the PHP Programming Forums category; I am embarrassed to ask this. If I set a cookie for 30 days, and the visitor comes back 25 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am embarrassed to ask this. If I set a cookie for 30 days, and the
visitor comes back 25 days later but I do nothing to re-set the cookie, will his cookie expire in 5 days, or does his browser automatically reset it to another 30 days? |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Brian Dunning wrote: > I am embarrassed to ask this. If I set a cookie for 30 days, and the > visitor comes back 25 days later but I do nothing to re-set the cookie, > will his cookie expire in 5 days, or does his browser automatically > reset it to another 30 days? > > --PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > It will expire in 5 days. - -- Christopher Weldon, ZCE President & CEO Cerberus Interactive, Inc. cweldon@cerberusonline.com 979.739.5874 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFBaHLZxvk7JEXkbERAgBXAJ400jfYjm5EggSZpCKt8s 2tnEpy5QCgt3yZ 8Och6y0aCPxgJw6t1R/VQnE= =oH63 -----END PGP SIGNATURE----- |
|
|||
|
Brian Dunning wrote:
> I am embarrassed to ask this. If I set a cookie for 30 days, and the > visitor comes back 25 days later but I do nothing to re-set the > cookie, will his cookie expire in 5 days, or does his browser > automatically reset it to another 30 days? > That depends on if you reset the cookie when they come back or not. If your routines set the cookie only if the cookie does not already exist, then it would not reset the cookie at 25 days, so it would indeed expire 5 days after that. If you check to see if the cookie exists first, and then reset the expiration date at that time, then the cookie would last for another 30 days... Tim. |