Bug #12481: Cookie cannot be set if there is no output for a page
| From: | tcmleung at yahoo dot com | Date: | Tue, 31 Jul 2001 09:20:39 +0000 |
| Subject: | Bug #12481: Cookie cannot be set if there is no output for a page | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-61619@lists.php.net to get a copy of this message | ||
From: tcmleung@yahoo.com
Operating system: Window 2000 and IIS4
PHP version: 4.0.6
PHP Bug Type: IIS related
Bug description: Cookie cannot be set if there is no output for a page
Example
Below is code for test1.phtml
<?
setcookie("cokTest","test cookie",0,"/");
header("location:test2.phtml");
?>
End of test1.phtml
Below is code for test2.phtml
<?
echo "CokTest : $cokTest";
?>
End of test2.phtml
If I start to run test1.phtml, then the output is as the following:
CokTest :
It means that $cokTest cannot be set if there is no output in
test1.phtml.
There is no problem in Linux-apache platform.
--
Edit bug report at: http://bugs.php.net/?id=12481&edit=1