summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.module4
-rw-r--r--modules/user/user.pages.inc6
2 files changed, 3 insertions, 7 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 6d884b5b9..29fb8c492 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1970,10 +1970,8 @@ function _user_cancel($edit, $account, $method) {
// After cancelling account, ensure that user is logged out.
if ($account->uid == $user->uid) {
- // Destroy the current session.
+ // Destroy the current session, and reset $user to the anonymous user.
session_destroy();
- // Load the anonymous user.
- $user = drupal_anonymous_user();
}
else {
drupal_session_destroy_uid($account->uid);
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index e9778e32e..bfeea5778 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -136,12 +136,10 @@ function user_logout() {
watchdog('user', 'Session closed for %name.', array('%name' => $user->name));
- // Destroy the current session:
- session_destroy();
module_invoke_all('user_logout', NULL, $user);
- // Load the anonymous user
- $user = drupal_anonymous_user();
+ // Destroy the current session, and reset $user to the anonymous user.
+ session_destroy();
drupal_goto();
}