Cookies are being created each visit to the web site
| From: | Sam | Date: | Tue, 06 Nov 2001 14:17:31 +0000 |
| Subject: | Cookies are being created each visit to the web site | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73603@lists.php.net to get a copy of this message | ||
Hi all,
I have this strange problem,
I set a cookie on the first page on the web site.
It all works fine through out the site, as this cookie is called throughout.
Until I close the browser window and open a new one.
I go back to the site, and for some reason I need to set the cookie again.
Here is the code
$ID=md5 (uniqid (rand()));
setcookie ("cookie_country", "uk","time()+15724800");
mysql_query("INSERT INTO client VALUES('', '$ID',
'','','','','','','','','','','','','','','','','','','','','','','null','')
;")or die("No insert");
$getClientID=mysql_query("SELECT clientID FROM client WHERE
uniqueID='$ID'")or die("unable to get the client ID");
$clientID=mysql_fetch_row($getClientID);
setcookie ("client", $clientID[0],"time()+15724800");
print "<HTML><HEAD><meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0;
url=$pageGoTo\"></head></html>";
as when I open the new window, the code that first is used is this...
if (isset($cookie_country))
{
code
}
$cookie_country is the cookie set previously, but this doesn't seem to have
been stored.
I have checked settings and cookies are enabled.
Can anyone shed some light on this?
Thanks
Sam
p.s. Also I'm only on the digest, so if you could reply directly to me as
well, that would be a bonus.