|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4066 setcookie not modifying HTTP Cookie string
Submitted: 2000-04-07 09:29 UTC Modified: 2002-09-30 18:07 UTC
From: mark at wiggis dot com Assigned:
Status: Wont fix Package: Misbehaving function
PHP Version: 3.0.15 OS: Linux (Redhat 6.0/6.1)
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
47 - 17 = ?
Subscribe to this entry?

 [2000-04-07 09:29 UTC] mark at wiggis dot com
The two pages (appended) demonstrate the bug. First of all load test2.php3. The page should show nothing but the "Reload" link. If you click "Reload", I would expect it to show the value of the cookie "value". Then subsequent attempts to reload should show "valuex", then "valuexx" etc. This doesn't happen. Note that test.php3 contains only php script and produces no real "output" except for headers.

I've also tried reversing the order of the setcookie/header statements in test.php3 with no effect on the output. 

I've tried this with linux/apache/mod_php3 and linux/apache/php3 standalone. Both exhibit the same behavior -however- with W98/apache/php3 standalone it works fine.

I'm not a C programmer.. Help!


// Cookie example

if (isset($mycookie)) {
   setcookie("mycookie","value" . "x");
} else {

header("Location: test2.php3");



print $mycookie . "<br>";


<a href="test.php3">Reload</a>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 18:07 UTC]
most clients ignore SetCookie headers for redirects
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 00:03:35 2022 UTC