I finally got my code working for a password protect script. It's still in its infancy, so I understand it isn't secure. My problem is that I seem to have problems across a number of different computers and browsers. From what I've seen, firefox has no problem with the cookies being set. I'm running into trouble on certain machines not setting cookies.
What I've seen is that on one machine, I have a system with ie, chrome, and firefox. The cookies don't work on chrome, but work with ie and firefox. On my linux machine, firefox works without a hitch. I don't have chrome installed on it so, I can't test that. Then on another machine, ie doesn't want to work with the website. I would think that it's a problem with the privacy settings, but it appears that they are all the same.
The odd thing about the chrome problem, is that I can see the cookie for the session, but I can't see the cookie that I set. So, obviously that is a problem, but I don't know why. I have the same problem with IE. I've set the IE machines to accept all cookies and have had no luck. The chrome browser is set to "Allow local data to be set".
Thanks in advance
if (isset($_COOKIE["Cookie"])){
FormatScreen();
}
else if ($_POST['access_password']){
$PasswordEntered = crypt($_POST['access_password'],$salt);
if ($PasswordEntered == $RealPassword){
setcookie("Cookie", $PasswordEntered, time()+600, '/');
FormatScreen();
}
else{
echo LoginScreen();
}
}