|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12481 Cookie cannot be set if there is no output for a page
Submitted: 2001-07-31 05:20 UTC Modified: 2002-06-18 18:38 UTC
From: tcmleung at yahoo dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.0.6 OS: Window 2000 and IIS4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 + 3 = ?
Subscribe to this entry?

 [2001-07-31 05:20 UTC] tcmleung at yahoo dot com
Below is code for test1.phtml
	setcookie("cokTest","test cookie",0,"/");
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-11 12:23 UTC]
Dupe of #9802
 [2002-06-18 18:38 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

 [2002-10-17 16:00 UTC] dhemelings at hotmail dot com
This bug isn't fixed, I installed PHP 4.2.3 on a Win 2000 Server box and experience the same problem. When I try it on my Win XP machine it works.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 08:01:28 2024 UTC