function user_logout_current_user

Logs the current user out.

2 calls to user_logout_current_user()
user_logout in drupal/modules/user/user.pages.inc
Menu callback; logs the current user out, and redirects to the home page.
user_pass_reset in drupal/modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.

File

drupal/modules/user/user.pages.inc, line 205
User page callback file for the user module.

Code

function user_logout_current_user() {
  global $user;
  watchdog('user', 'Session closed for %name.', array(
    '%name' => $user->name,
  ));
  module_invoke_all('user_logout', $user);

  // Destroy the current session, and reset $user to the anonymous user.
  session_destroy();
}