Session should be destroyed after invoke hook_user_logout($account) so that variable $account is still active
diff --git a/sites/all/modules/autologout/autologout.module b/sites/all/modules/autologout/autologout.module
index 834162b..dab86ec 100644
--- a/sites/all/modules/autologout/autologout.module
+++ b/sites/all/modules/autologout/autologout.module
@@ -223,15 +223,11 @@ function autologout_init() {
// code from core(user.pages.inc), can't use it directly because we need need a custom goto
watchdog('user', 'Session closed for %name.', array('%name' => $user->name));
- // Destroy the current session:
- session_destroy();
- // Only variables can be passed by reference workaround.
- $null = NULL;
- user_module_invoke('logout', $null, $user);
-
- // Load the anonymous user
- $user = drupal_anonymous_user();
+ module_invoke_all('user_logout', $user);
+ // Destroy the current session, and reset $user to the anonymous user.
+ session_destroy();
+
$redirect_url = filter_xss_admin(_autologout_local_settings('redirect_url'));
if ( $redirect_url != '' ) {
drupal_goto($redirect_url);
| Comment | File | Size | Author |
|---|---|---|---|
| patch.diff | 1.05 KB | ipallian |
Comments
Comment #1
jrglasgow commentedpatch has been committed