Wednesday, July 21, 2010

Session Time out in PHP - Simple Example

session_start();

// 10 mins in seconds
$inactive = 600;

$session_life = time() - $_session['timeout'];

if($session_life > $inactive)
{ session_destroy(); header("Location: logoutpage.php"); }

S_session['timeout']=time();

No comments:

Post a Comment