Hope that helps Following is my php code which should be unset all session after one hour if user inactivity. But after few minutes inactivity it's unset all session variable. It's should one hour Inactivity. , You just made a small assignment error :
$sessinTime = $_SESSION['timeout'] = time();
$sessinTime = $_SESSION['timeout'];
is it correct to unset the session variable for a particular index as the vay whole session is made unset in PHP?
By : rockcafe
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , If you want to remove an array item and reindex the array, you can use array_splice to do so:
fixed the issue. Will look into that further As stated in comments, you did not start the session and is required to be inside all files using sessions. Therefore, add session_start(); at the top and underneath your opening PHP tag.
// Then the rest of your code