Logout an inactive user using PHP
问题 I am trying to log a user out of my CMS after a set amount of time. By inactive I mean has not clicked the mouse or typed on there keyboard. So after 30 minutes of inactivity my log out function is ran. There is already a log out function built in to the CMS I am using - <?php session_start(); if (isset($_SESSION['user_id'])){ $login = 1; }else{ $login = 0; } function confirm_logged_in() { if (!isset($_SESSION['user_id'])) { //redirect header("Location: /_cms/login.php?login=0"); } } function