I am trying to create a login script, but for reasons unknown to me, it is not working.
The user is presented a username/password box on one page, and the form goes to login.php, where it checks against a MySQL database to validate them. If they are valid, it runs the following code:
$lifetime = time() + 600;
setcookie("phpvcrcookie", $username, $lifetime);
header("Location: $HTTP_REFERER");
When they go back to the first page, it looks to see if $phpvcrcookie is set. However, it never finds it when I test it. What is the problem?