note 9156 added to setcookie

From: Date: Thu, 19 Oct 2000 09:13:24 +0000
Subject: note 9156 added to setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-6695@lists.php.net to get a copy of this message
Finally, I could overcome the "cookie monster". The setcookie() function was not working correctly in IE4SP1. Therefore, I tried the header directive to set the cookie. However, unless a large value for the time was given, it kept deleting the cookie instead of setting it. I finally found out that this "large" time was the difference between the local time and the GMT time. I was setting the "expire" parameter by calling the strftime("%A, %d-%b-%Y %H:%M:%S", $exp) function to convert the time to the required format. After changing that syntax to gmstrftime("%A, %d-%b-%Y %H:%M:%S", $exp), the cookies work very well in all the browsers. Remember send the GMT time and not the local time. http://www.php.net/manual/function.setcookie.php

« previous php.notes (#6695) next »