I want to auto logout from index.php after session expired in 10 minutes. Please help?
I already have this:
//this is login.php
//register the session for user and password
session_register("userName");
session_register("password");
if($userType=="Web_User"){
header("location:index.php?");
}
//index.php
//check session start or not
<?php
if (!isset($_SESSION['start_time']))
{
$str_time = time();
$_SESSION['start_time'] = $str_time;
}
echo $_SESSION['start_time'];
//here I want to expired if user inactive for 10 minutes and redirect to the login.php
?>