note 59288 deleted from function.setcookie by jacques

From: Date: Fri, 02 Dec 2005 18:59:32 +0000
Subject: note 59288 deleted from function.setcookie by jacques
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-99481@lists.php.net to get a copy of this message
Note Submitter: bmitchell at 2s4e dot com ---- Regarding martin's (and subsequently, Ray's) comment: To delete a cookie, your code specifies setting the expiry to time()-1. Being that the expiry is based on the *user* time, I would think that this could cause problems (based on timezones)? If your server is located on the west coast of the US (San Jose, California) and your user is located on the east coast (Miami, Florida), setting the expiry to your servers time minus 1 second means the user doesn't delete the cookie for approximately 2:59:59 (3 hours difference in time, minus one second). Unless I'm wrong about how PHP handles cookies, you'd be much safer off setting the expiry to simply '1', or Jan 1 1970.

« previous php.notes (#99481) next »