While the user is logged in, some times when he is entes a secure page, the user will be referred automatically to the login page (sessions are unset or killed)
So what is the problem?? Here is my code plan for:.
LOGIN:
Code: Select all
if(userane == $_POST['username'] and password == $_POST['username'])
$_SESSION['user_id'] == $row_login_info['user_id'];
else
$error='ERROR';Code: Select all
session_start();
if(!isset($_SESSION['user_id']) || empty($_SESSION['user_id'])){
header('Location:login.php');
}why do you think that the user when he logged in, suddenly in a random duration after login, he will be automatically "LOGGED OUT" ???