|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-13 16:37 UTC] sniper@php.net
[2003-01-14 03:49 UTC] ElfQrin at ElfQrin dot com
[2003-01-14 06:50 UTC] ElfQrin at ElfQrin dot com
[2003-01-14 07:05 UTC] msopacua@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
PHP can't set cookies on Windows 2000 systems after testing a non-existing variable. This problem was reported in the following conditions: - Windows 2000 server SP-3 (IIS not installed) - Apache v2.0.43 (confirmed on Apache v1.3.27 as well) - PHP 4.3.0 (confirmed on 4.2.2 and 4.2.3 as well) The problem happens with Windows 2000 only. On Windows 98 with the very same configuration, or on Linux, everything works fine. Try the following code: <? # $test="X"; setcookie("debug","1",time()+60*60*24*30,"",""); if ($test=="") {setcookie("debug","2",time()+60*60*24*30,"","");} setcookie("debug","3",time()+60*60*24*30,"",""); ?> <HTML> <HEAD> <TITLE>w2k/PHP setcookie bug test</TITLE> </HEAD> <BODY> BEGIN<BR> <? echo "Cookie: [".$_COOKIE["debug"]."] (HIT RELOAD)<BR>"; ?> END<BR> </BODY> </HTML> When $test is not set, the cookie "debug" remains set to 1, while when $test is set to any value (including "", an empty string), cookie will be eventually properly set to 3.