Monday 22 September 2014

Automatic Logout after 15 minutes of inactive

<?php
     session_start
();
     
$_SESSION['session_time'] = time(); //got the login time for user in second
     
$session_logout 900//it means 15 minutes.
     //and then cek the time session
    
if($session_logout >= $_SESSION('session_time']){
        
//user session time is up
       //destroy the session
      
session_destroy();
     
//redirect to login page
     
header("Location:the-path-your-login-page.php");
    }
?>



















 

No comments:

Post a Comment