function user_logout
Same name and namespace in other branches
- 11.x core/modules/user/user.module \user_logout()
- 10 core/modules/user/user.module \user_logout()
- 9 core/modules/user/user.module \user_logout()
- 8.9.x core/modules/user/user.module \user_logout()
- 7.x modules/user/user.pages.inc \user_logout()
Logs the current user out.
Deprecated
in drupal:11.5.0 and is removed from drupal:13.0.0. Use \Drupal\user\LogoutFinalizer::finalizeLogout() instead.
See also
https://www.drupal.org/node/3379194
1 call to user_logout()
- RestAuthenticationController::userLogout in core/
modules/ rest/ src/ Controller/ RestAuthenticationController.php - Logs the user out.
File
-
core/
modules/ user/ user.module, line 608
Code
function user_logout() : void {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal\\user\\LogoutFinalizer::finalizeLogout() instead. See https://www.drupal.org/node/3379194', E_USER_DEPRECATED);
\Drupal::service(LogoutFinalizer::class)->finalizeLogout();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.