I am using this block of code for mannual logout but i want automatic logout after 5 minutes of inactivity on website. How to do that? Thanks
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_destroy();
if(!session_is_registered('username')) {
header("location: logout_msg.html");
} else {
print "<h2>Could not log you out, sorry the system encountered an error.</h2>";
}
exit();
?>