user_logout

Versions
4.6 – 7
user_logout()

Menu callback; logs the current user out, and redirects to the home page.

▾ 1 function calls user_logout()

_menu_site_is_offline in includes/menu.inc
Checks whether the site is in maintenance mode.

Code

modules/user/user.pages.inc, line 148

<?php
function user_logout() {
  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();

  drupal_goto();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.