Re: deleting one cookie is deleting both..why? (tiny scripts)
| From: | Chris Shiflett | Date: | Thu, 17 Jul 2003 15:34:33 +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-155637@lists.php.net to get a copy of this message | ||
--- 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/