2015-05-05 137 views

回答

-1
if(!isset($_SESSION)) session_start(); // start session if was not start. 

$_SESSION['expire_time'] = time()+(60*15); //set expire for 15 minutes 

if(isset($_SESSION['expire_time']) && $_SESSION['expire_time'] < time()) 
    // user session is expired 
else 
    // user session is valid