Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1.  
  2. session_name('tzLogin');
  3. // Starting the session
  4.  
  5. session_set_cookie_params(2*7*24*60*60);
  6. // Making the cookie live for 2 weeks
  7.  
  8. session_start();
  9.  
  10. if($_SESSION['id'] && !isset($_COOKIE['tzRemember']) && !$_SESSION['rememberMe'])
  11. {
  12.     // If you are logged in, but you don't have the tzRemember cookie (browser restart)
  13.     // and you have not checked the rememberMe checkbox:
  14.  
  15.     $_SESSION = array();
  16.     session_destroy();
  17.    
  18.     // Destroy the session
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement