note 26152 added to function.setcookie

From: Date: Sun, 20 Oct 2002 08:09:36 +0000
Subject: note 26152 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-38317@lists.php.net to get a copy of this message
If you try to set an array of cookies by using array notation make sure you have the same expire length of the cookie. If you don't, only the first cookie in the array or cookies matching the same expiration date will be created. // This will NOT work. setcookie("value[one]","value1",time()+5184000); setcookie("value[two]","value2",time()+14400); // This will work. setcookie("value[one]","value1",time()+5184000); setcookie("value[two]","value2",time()+5184000); It also does NOT matter when the expiration date is for the cookie. They can be set for different dates. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+26152 http://master.php.net/manage/user-notes.php?action=delete+26152 http://master.php.net/manage/user-notes.php?action=reject+26152

« previous php.notes (#38317) next »