Try adding "/" after the time argument to SetCookie.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Aaron Chan <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, August 10, 2001 6:05 PM
Subject: Cookie only worked on "/" but not in any sub-directories


> 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
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to