deleting one cookie is deleting both..why? (tiny scripts)
| From: | Ryan A | Date: | Thu, 17 Jul 2003 12:54:05 +0000 |
| Subject: | deleting one cookie is deleting both..why? (tiny scripts) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-155595@lists.php.net to get a copy of this message | ||
Hi again,
I am setting 2 cookies like so:(setCookie.php)
<?php
setcookie("name1","1","0","",".bestwebhosters.com");
setcookie("name2","1","0","",".bestwebhosters.com");
echo "done";
?>
then I am trying to delete the second cookie like so:(delCookie.php)
<?php
setcookie("name2","1","-3600","",".bestwebhosters.com");
echo "done";
?>
<a href=http://bestwebhosters.com/testing/ReadCookieEx.php>Read</a>
When I check ReadCookie it shows me that both hav been deleted....why?
How can i delete just one of the two cookies?
*******************************************
(for those of you intrested heres my ReadCookie file)
<?php
if (isset($_COOKIE ['name1'])){
echo $_COOKIE ['name1'];
}else{echo "wrong1";}
if (isset($_COOKIE ['name2'])){
echo $_COOKIE ['name2'];
}else{echo "wrong2";}
?>
********************************************
Kindly reply.
Cheers,
-Ryan