Really stupid cookie question

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


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-11-2006
Brian Dunning
 
Posts: n/a
Default Really stupid cookie question

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?
Reply With Quote
  #2 (permalink)  
Old 09-11-2006
Christopher Weldon
 
Posts: n/a
Default Re: [PHP] Really stupid cookie question

-----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-----
Reply With Quote
  #3 (permalink)  
Old 09-11-2006
Tim Traver
 
Posts: n/a
Default Re: [PHP] Really stupid cookie question

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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0