hi,
i have made a cookie script that works on windows perfectly, but when i upload it on the server, it shows, taht the cookie is set or smth, but it's not :[
here's the script:
<?
if(($username=="user") && ($password == "pass")) {
setcookie($username,$password,time() + 3600) or die ("Cookie not set :[");
echo "<meta htp-equiv=\"Refresh\" content=\"0; URL=index2.php\">";
}
else echo "Blah blah";
?>
and here's the index2.php:
<?
if((isset($user)) && ($user == "pass")){
echo "You're loggen in";
}
?>
p.s. hmmm i have an idea - may be the time() +3600 is wrong..., and because the server time and the computer time are not the same, the cookie expires earlier.... is it so?
i have just tested the script with time() +1000000000 and it works 🙂)
so is it the problem?