ID:               21569
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Windows 2000 only
 PHP Version:      4.3.0
 New Comment:

This is a shortest example:

<?
# $test="";
setcookie("debug","1",0,"","");
if ($test=="") { echo ""; }
setcookie("debug","3",0,"","");
echo "Cookie: [".$_COOKIE["debug"]."] (HIT RELOAD)<BR>";
?>


Previous Comments:
------------------------------------------------------------------------

[2003-01-10 13:14:02] [EMAIL PROTECTED]

I've submitted a specific bug. It depends either from PHP or Windows
2000 itself in some way, because I've tested it deeply in many
configurations of operating systems, Apache and PHP versions.

The sample code provided is a proof of concept, not a code I'm asking
advice about.

------------------------------------------------------------------------

[2003-01-10 12:56:40] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

------------------------------------------------------------------------

[2003-01-10 12:55:06] [EMAIL PROTECTED]

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.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21569&edit=1

Reply via email to