Re: Existing cookie doesn't seem to exist.

From: Date: Tue, 14 Nov 2000 14:20:33 +0000
Subject: Re: Existing cookie doesn't seem to exist.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-25185@lists.php.net to get a copy of this message
Basurero wrote:
I've been reading all the posts on the setcookie() topic in the group, but I couldn't find an answer to my problem. I send a cookie like this on one page: setcookie("ClientName",$the_name,time()+3600,$PHPSELF); And I try to catch it on another page (or when the user comes back to that page) like this: <? if(isset($ClientName)) {
    echo "Hello ". $ClientName .", nice to see you.";
} else {
    echo "Hello Guest.";
} ?> Even though the cookie is set (I can see it in the .netscape/cookies file) I always get the "Hello Guest message".
There's been like 895,457 cookie threads this week alone. *sigh* :-) Put in a value for the path and a domain arguments in setcookie(). setcookie("ClientName", $the_name, time()+3600, '/', '.domain.com'); Replace .domain.com with your domain, and don't forget the leading "." It's probably best to go in and manually remove *every* cookie on disk that's related to your tests and start the test over with the above. -Brian

« previous php.general (#25185) next »