|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-04-30 18:20 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
If a browser sends more than one cookie to the server, only the first cookie sent gets parsed into a variable. Reproduce with the following code: --------- <? if ($set == 1) { SetCookie("first","apple"); SetCookie("second","orange"); } echo "[first:$first][second:$second]($HTTP_COOKIE)"; ?> <hr> <? phpinfo(); ?> ----------- when call it the first time with a query string of "set=1", I get two cookies sent to me, as expected. When I try the page again, I get [first:][second:orange](second=orange; first=apple) as output. The other cookie is in $HTTP_COOKIE and the output of phpinfo tells me: HTTP Request Headers / Cookie is: second=orange; first=apple; but the value "apple" doesn't get parsed into the variable "first".