Code Snippets
Login
Session timeout
Destroys session after a period of inactivity
Label
// Place after session_start() in index.php if (isset($_SESSION["activity"]) && time() - $_SESSION["activity"] > 180) { session_unset(); session_destroy(); header("location: ./"); exit(); }
Copy to clipboard
Copied!
©
Leerlandais 2024