Re: Simple Cookies not working
| From: | Thomas Buck | Date: | Wed, 10 Oct 2001 09:16:46 +0000 |
| Subject: | Re: Simple Cookies not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70612@lists.php.net to get a copy of this message | ||
I personally wouldn't bother with setting cookies by hand unless you have a really good reason to.
Use the session functions instead.
e.g.
<?
session_start();
session_register("cookie_test");
if (isset($cookie_test)) {
echo "Yes and here it is ''$cookie_test";
} else {
$cookie_test = "Cookie Set";
echo "No, but it has now been set.";
}
?>
Thomas.
At 10:07 10/10/01 +0100, Sam wrote:
Hi all, thanks for your help with my last problem...
I have this code
<?
if (isset($cookie_test))
{
print "YES and here it is '$cookie_test'";
}
else
{
setcookie ("cookie_test", "Cookie Set",time()+120);
print "No, but it has now been set.";
}
?>
This works on 98 PC's but not on win2000 PC's is this a PHP problem or an OS
problem?
All the IE configurations are the same.
Cheers
Sam Rose
p.s. Also I'm only on the digest, so if you could reply directly to me as
well, that would be a bonus.