Hello
I havea problem with the setcookie() command. I have some code which sets a cookie during a login. It works perfectly fine when I access the site from one PC but when I try it on a different PC it will not set the cookie? I am accessing it using the following: test.domain.com/admin/login.php
After some extensive research I thought I might have a problem with path or domain in the setcookie string so I created the following code and put it in the base directory and accessed it using www.domain.com/index.php and the cookie still does not set on one machine but does on the other? Can anyone give me some ideas. This is driving me nuts.
Both Machines are Win XP Home, Both same version of IE and both have identical cookie settings in Privacy settings?
CODE:
<?php
if (!isset($_COOKIE["keith"])) {
$value="keith";
setcookie("keith",$value,time()+1000);
header("Location: test.php");
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>Keith</title>
</head>
<body bgcolor="#ffffff">
<p><? if (isset($_COOKIE["keith"])) {
echo $_COOKIE["keith"];
} else {
echo "Cookie Not Set";
}
?>
</p>
</body>
</html>
Thank you in advance.