note 11562 deleted from function.setcookie by john

From: Date: Sat, 30 Nov 2002 16:15:30 +0000
Subject: note 11562 deleted from function.setcookie by john
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40154@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.

« previous php.notes (#40154) next »