Bug #4066: setcookie not modifying HTTP Cookie string
| From: | mark at wiggis dot com | Date: | Fri, 07 Apr 2000 13:29:50 +0000 |
| Subject: | Bug #4066: setcookie not modifying HTTP Cookie string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17700@lists.php.net to get a copy of this message | ||
From: mark@wiggis.com
Operating system: Linux (Redhat 6.0/6.1)
PHP version: 3.0.15
PHP Bug Type: Misbehaving function
Bug description: setcookie not modifying HTTP Cookie string
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!
test.php3
-----------------------------------------
<?
// Cookie example
if (isset($mycookie)) {
setcookie("mycookie","value" . "x");
} else {
setcookie("mycookie","value");
};
header("Location: test2.php3");
?>
----------------------------------------
test2.php3
----------------------------------------
<html>
<head>
</head>
<body>
<?
print $mycookie . "<br>";
?>
<a href="test.php3">Reload</a>
</body>
</html>
----------------------------------------