Guest User

Session Management

a guest
Sep 13th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. /*
  2. Session Time Out Management
  3. */
  4. if (isset($_SESSION['LAST_ACTIVITY']) && ((time()-$_SESSION['LAST_ACTIVITY']) > $site_settings->session_timeout) && $user->isLoggedIn()) {
  5.     session_unset(); // unset $_SESSION variable for the run-time
  6.     session_destroy(); // destroy session data in storage
  7.  
  8.     Redirect::to($us_url_root);
  9. }
  10. $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
Advertisement
Add Comment
Please, Sign In to add comment