hey, I'm using a login script and once the script makes sure that username and/or password are not blank and are valid, it creates cookies:
$md5_password = md5($_POST[password]);
setcookie("username","$_POST[username]",time()+30000000);
setcookie("password","$md5_password",time()+30000000);
echo "<meta http-equiv=refresh content=\"5;url=$siteurl/loggedin.php\">";
include("header.php");
print("<i>please wait while you are being logged in</i>");
the cookies must not be working because in my header/template I have a code like this:
if($_COOKIE[username] AND $_COOKIE[password])
{
print("
<a class='toplinks' href='index.php'>home</a> - <a class='toplinks' href='logout.php'>logout</a> - <a class='toplinks' href='filemanager.php'>file manager</a>");
}
else
{
print("
<a class='toplinks' href='index.php'>home</a> - <a class='toplinks' href='login.php'>login</a> - <a class='toplinks' href='signup.php'>signup</a>");
}
the above code does not work for the people who have tested it. they get the regular "signup" menu, not the logged in one. I know that they all have cookies enabled.
to make this even more frustrating, it works for me! it works fine. everything. so what does that mean? how can the cookies work for me, and not them? I've used this exact login script before and it worked fine for everyone. what am I doing wrong this time? 🙁
here's one possibility: the whole page is displayed through an iframe. I'm using FireFox on a mac, but is it possible that for, say, a Windows user using IE the cookies would not work properly because of the iframe?