Cookie only worked on "/" but not in any sub-directories
| From: | Aaron Chan | Date: | Fri, 10 Aug 2001 23:05:27 +0000 |
| Subject: | Cookie only worked on "/" but not in any sub-directories | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62229@lists.php.net to get a copy of this message | ||
Hi,
First of all, I'm very new to PHP. I tried to call setcookie() function to
set a cookie using the following code:
setcookie ("TestCookie", "Some Value", time()+3600);
echo $TestCookie, "<BR>";
It works perfectly for the root directory, but when i try to do the same
thing in another directory called '/phptest/', it didn't work at all. I
tried to switch on netscape's "Warn me before accepting cookie" and saw that
the cookie was indeed sent to the client. However, I could not read back the
cookie's value no matter how many times i refresh netscape. Can anyone tell
me what's going on?
Any help would be greatly appreciated.
Thanks,
Aaron