Re: cookie crumbles
| From: | Jaap van Ganswijk | Date: | Mon, 01 Sep 2003 07:48:39 +0000 |
| Subject: | Re: cookie crumbles | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161344@lists.php.net to get a copy of this message | ||
At 2003-09-01 00:49 -0400, John Taylor-Johnston wrote:
>I create this cookie, using Javascript::
>
>testals.flsh.usherb.ca FALSE / FALSE 1062433227 weather.htm99999995 1
>
>If the browser is reloaded, I want php to read the cookie and do my else statement.
>Even after a browser shut-down and restart, I cannot get PHP to read the cookie (first part of
>my if statement).
>
>If I use phpinfo(), it does confirm that:
>
>_COOKIE["weather.htm99999995"] = 1
>
>What weird quirk have I missed this time?
>
>
><?php
>
>$StudentId = "weather.htm99999995";
Remove 'weather.htm' from this string.
>if (!isset($_COOKIE["weather.htm$StudentId"]))
>{
>echo "Cookie not found, not reading weather.htm$StudentId<br>";
>echo "\$_COOKIE[\"weather.htm$StudentId\"]".
>$_COOKIE["weather.htm$StudentId"]."-<hr>";
>
>}else{
>echo "cookie found, yay!
>".$_COOKIE["weather.htm$StudentId"]."-<hr>";
>#phpinfo();
>}
>?>
Greetings,
Jaap