You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/01/11 10:18:54 UTC
DO NOT REPLY [Bug 15991] New: -
Apache (PHP?) can't set cookies after a test with an unset variable
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15991>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15991
Apache (PHP?) can't set cookies after a test with an unset variable
Summary: Apache (PHP?) can't set cookies after a test with an
unset variable
Product: Apache httpd-2.0
Version: 2.0.43
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Major
Priority: Other
Component: All
AssignedTo: bugs@httpd.apache.org
ReportedBy: ElfQrin@ElfQrin.com
I think this is a PHP problem, but I've submitted the bug to them first, but
they replied "Sorry, but your problem does not imply a bug in PHP itself." and
apparently think the cause might be Apache.
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.
Example:
<?
# $test="X";
setcookie("debug","1",time()+60*60*24*30,"","");
if ($test=="") {# test}
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org