Re: cookie crumbles
| From: | John Taylor-Johnston | Date: | Thu, 04 Sep 2003 06:08:53 +0000 |
| Subject: | Re: cookie crumbles | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161626@lists.php.net to get a copy of this message | ||
As it turned out, all I had to do was get rid of the period "." and things began to work
better.
I also had to remember to close my browser and empty the cookie jar.
Thanks,
J
Jaap Van Ganswijk wrote:
> 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,