Login form > Check Login Script > Login Success Script > index.htm
on the first script, this is code that sets the cookie:
Code: Select all
// Register $myusername, $mypassword and redirect to file "login_success.php"
$expire=time()+60*60*24*5;
setcookie('user', $username, $expire);
header("location:login_success.php");Code: Select all
<?php
if(!isset($_COOKIE['user']))
{
header("location:login/main_login.htm");
}
?>Now for some reason, it will go to the Login Success page, and not have a problem even though that page has the cookie checking code on it. However, when the Login Success page then redirects to the index.htm page, it goes straight back to the login form, thinking the cookie's not there. The second bit of code is identical on all the pages i have protected by the login system.
Thanks in advance.