So, I've written some code that kills the session on timeout, but it will not redirect to the login screen unless I try to navigate to another page in the app. Any suggestions?
Code:
if(isset($_SESSION['start']) ) {
$session_life = time() - $_SESSION['start'];
if($session_life > $inactive) {
$_SESSION = array();
$session_destroy();
header('Location:login.php');
$timedout = '1';
}
}
Comment