I want to destroy session if users are not doing any kind of activity on website. At that time after 5 users automatically redirect on index page. How is it possible? Is pos
session_start(); $t=time(); if (isset($_SESSION['logged']) && ($t - $_SESSION['logged'] > 900)) { session_destroy(); session_unset(); header('location: index.php'); }else {$_SESSION['logged'] = time();}