if(($_SESSION['time'] - time()) > 60) { session_distroy(); header("Location: login.php"); exit(); } else { $_SESSION['time'] = time(); }