Cookie oddity
| From: | Duncan Hill | Date: | Mon, 07 Aug 2000 00:03:57 +0000 |
| Subject: | Cookie oddity | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10390@lists.php.net to get a copy of this message | ||
I've run into a peculiar oddity with cookies that I don't quite
follow. Hopefully someone here can clarify for me..
If I use the following code:
{
// Good password, pass them onwards.
setcookie("Trade", $character, time()+3600);
header("Location: http://localhost:1312/trade/test.php");
}
And test.php contains
echo "$Trade";
I get no output in test.php.
However, if the location refers to PHP_SELF, and I do an
if (isset($Trade)) { echo "$Trade"; }
in the file where the cookie is set, the value of the cookie is
displayed.
I checked this with both Lynx and Netscape, and Lynx shows the cookie
being set, and shows the cookie in the cookie jar once I reach the
test.php file.
Where am I going wrong?
--
Duncan Hill Sapere aude
My mind not only wanders, it sometimes leaves completely.