You are here

function persistent_login_user_login in Persistent Login 7

Implements hook_user_login().

File

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

Code

function persistent_login_user_login(&$edit, $account) {

  // If we are coming from a login form, $edit['persistent_login']
  // is set if the user checked it.  If we are coming from
  // persistent_login_check(), $edit['persistent_login'] is also
  // set along with pl_series and pl_expiration.  Either way, issue a
  // new PL cookie, preserving series and expiration if present.
  if (!empty($edit['values']['persistent_login'])) {
    _persistent_login_create_cookie($account, $edit);
  }

  // Assume this is a non-PL login; clear persistent_login_login.
  // If this is a PL login, it will be set again by
  // _persistent_login_check (our caller).
  unset($_SESSION['persistent_login_login']);

  // see comment in _form_alter()
  unset($_SESSION['persistent_login_reauth']);
}