note 21999 added to function.setcookie

From: Date: Mon, 03 Jun 2002 13:56:59 +0000
Subject: note 21999 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-31380@lists.php.net to get a copy of this message
i have a problem with cookies under win32 PHP 4.2.1. when i send three cookies in one page after one by one, only the last will be set, i check them in the next page. here is the code: setcookie("c_authed", "OK", time()+3600); setcookie("c_afadmin", "1", time()+3600); setcookie("c_afkod", "1", time()+3600); header("Location: index_authed.php"); and i read them in the first lines of index_authed.php: echo "|".$HTTP_COOKIE_VARS[c_authed]."|\n"; echo "|".$HTTP_COOKIE_VARS[c_afadmin]."|\n"; echo "|".$HTTP_COOKIE_VARS[c_afkod]."|\n"; it generates this output: || || |1| if i swap the lines, every time only the last cookie variable will be set (with correct, corresponding value). the problem is, so, it is not working in win32 PHP 4.2.1 but the _exactly same code_ works under linux, PHP 4.0.3. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+21999 http://master.php.net/manage/user-notes.php?action=delete+21999 http://master.php.net/manage/user-notes.php?action=reject+21999

« previous php.notes (#31380) next »