Advertisement
rodro1

destroy_login_after_time php

Feb 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public function destroy_login_after_time(){
  2. if (isset($_SESSION["LAST_ACTIVITY"]) && (time() - $_SESSION["LAST_ACTIVITY"] > $this->destroy_login_after_time)) {
  3. session_destroy();
  4. session_unset();
  5. }
  6.  
  7. $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement