diff options
-rw-r--r-- | modules/user.module | 4 | ||||
-rw-r--r-- | modules/user/user.module | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/user.module b/modules/user.module index af603cd75..6bfd825b9 100644 --- a/modules/user.module +++ b/modules/user.module @@ -956,7 +956,9 @@ function user_logout() { // Destroy the current session: session_destroy(); module_invoke_all('user', 'logout', NULL, $user); - unset($user); + + // We have to use $GLOBALS to unset a global variable: + unset($GLOBALS['user']); drupal_goto(); } diff --git a/modules/user/user.module b/modules/user/user.module index af603cd75..6bfd825b9 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -956,7 +956,9 @@ function user_logout() { // Destroy the current session: session_destroy(); module_invoke_all('user', 'logout', NULL, $user); - unset($user); + + // We have to use $GLOBALS to unset a global variable: + unset($GLOBALS['user']); drupal_goto(); } |