Re: deleting one cookie is deleting both..why? (tiny scripts)
| From: | Ryan A | Date: | Thu, 17 Jul 2003 16:59:51 +0000 |
| Subject: | Re: deleting one cookie is deleting both..why? (tiny scripts) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155649@lists.php.net to get a copy of this message | ||
Hey,
Thanks for replying.
As you might have guessed, i'm new to using cookies....so how do i make sure
that the cookie will work for http://best.... and www.best... and
blah.bestweb.... etc? because thats what I thought I was doing by using
.bestwebhosters.com
Thanks,
-Ryan
> --- Ryan A <ryan@jumac.com> wrote:
> > I am setting 2 cookies like so:(setCookie.php)
> ...
> >
> > setcookie("name1","1","0","",".bestwebhosters.com");
> >
> > setcookie("name2","1","0","",".bestwebhosters.com");
> ...
> > then I am trying to delete the second cookie like so:(delCookie.php)
> ...
> >
> > setcookie("name2","1","-3600","",".bestwebhosters.com");
> ...
> > <a
> > href=http://bestwebhosters.com/testing/ReadCookieEx.php>Read</a>
> >
> > When I check ReadCookie it shows me that both hav been deleted....why?
>
> Don't delete the cookie, and you'll still find that both are "deleted".
The
> truth is that neither would be deleted, but they will only be sent to
domains
> within .bestwebhosters.com, which http://bestwebhosters.com is
> not.
>
> Hope that helps.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/
>
----- Original Message -----
From: "Chris Shiflett" <shiflett@php.net>
To: "Ryan A" <ryan@jumac.com>; <php-general@lists.php.net>
Sent: Thursday, July 17, 2003 5:34 PM
Subject: Re: [PHP] deleting one cookie is deleting both..why? (tiny scripts)
> --- Ryan A <ryan@jumac.com> wrote:
> > I am setting 2 cookies like so:(setCookie.php)
> ...
> >
> > setcookie("name1","1","0","",".bestwebhosters.com");
> >
> > setcookie("name2","1","0","",".bestwebhosters.com");
> ...
> > then I am trying to delete the second cookie like so:(delCookie.php)
> ...
> >
> > setcookie("name2","1","-3600","",".bestwebhosters.com");
> ...
> > <a
> > href=http://bestwebhosters.com/testing/ReadCookieEx.php>Read</a>
> >
> > When I check ReadCookie it shows me that both hav been deleted....why?
>
> Don't delete the cookie, and you'll still find that both are "deleted".
The
> truth is that neither would be deleted, but they will only be sent to
domains
> within .bestwebhosters.com, which http://bestwebhosters.com is
> not.
>
> Hope that helps.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/
>