1
session logout and record
CGuild1.com > Tips & Tricks > session logout and record

Log a user out automatically and record SESSION

Here is how to automatically log a user out and record the time.

$idletime=60;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime){
    session_destroy();
    session_unset();
}else{
    $_SESSION['timestamp']=time();
}
//on session creation
$_SESSION['timestamp']=time();


I found this over here at GitHub.
©2024 CGuild1.com