note 11562 added to setcookie

From: Date: Sun, 25 Feb 2001 10:14:43 +0000
Subject: note 11562 added to setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-11582@lists.php.net to get a copy of this message
In IE 5.5 (and maybe since 5.1) and PHP4.0.1pl2 cookies didn't work in the way manual states, you should use semicolons in the expire field. i.e.: setcookie ("TestCookie", $value,time()+3600); //doesn't work setcookie ("TestCookie", $value,"time()+3600"); //it works if you set a variable to determine the time offset for the cookie use: $timeoffset=3600 setcookie ("TestCookie", $value,"time()+$timeoffset"); This is the only way it worked for me. http://www.php.net/manual/en/function.setcookie.php

« previous php.notes (#11582) next »