summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module4
1 files changed, 1 insertions, 3 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);