You are here

function persistent_login_user_logout in Persistent Login 7

Same name and namespace in other branches
  1. 8 persistent_login.module \persistent_login_user_logout()

Implements hook_user_logout().

1 call to persistent_login_user_logout()
_persistent_login_check in ./persistent_login.module
Do the real work. Note that we may be in BOOTSTRAP_PAGE_CACHE mode with few modules loaded.

File

./persistent_login.module, line 225
Provide a "Remember Me" checkbox in the login form.

Code

function persistent_login_user_logout($account) {
  $cookie_name = _persistent_login_get_cookie_name();
  if (!empty($_COOKIE[$cookie_name])) {
    _persistent_login_setcookie($cookie_name, '', REQUEST_TIME - 86400);
    unset($_SESSION['persistent_login_check']);
    unset($_SESSION['persistent_login_login']);
    unset($_SESSION['persistent_login_reauth']);
    list($uid, $series, $token) = explode(':', $_COOKIE[$cookie_name]);
    _persistent_login_invalidate('logout', "uid = :uid AND series = :series", array(
      ':uid' => $uid,
      ':series' => $series,
    ));
  }
}