You are here

function bakery_user_logout in Bakery Single Sign-On System 7.2

Same name and namespace in other branches
  1. 8.2 bakery.module \bakery_user_logout()
  2. 6.2 bakery.module \bakery_user_logout()
  3. 6 bakery.module \bakery_user_logout()
  4. 7.4 bakery.module \bakery_user_logout()
  5. 7.3 bakery.module \bakery_user_logout()

Implements hook_user_logout().

File

./bakery.module, line 139
Module file for the Bakery.

Code

function bakery_user_logout($account) {
  global $user;
  $cookie = _bakery_validate_cookie();

  // Only delete the SSO cookie if the name is the same in case there was an
  // existing session that's being logged out and SSO cookie is for new session.
  if ($user->uid && $cookie && $cookie['name'] === $user->name) {
    _bakery_eat_cookie();
  }

  // Destroy session cookie.
  _bakery_eat_cookie(session_name());
}