'logout' is not called by hook_user when logging out.

giantjupiter - December 5, 2008 - 13:39

Hi,

'logout' is not called by hook_user() when logging out.

I added the line

drupal_set_message('in xxxx_user(), op = ' . $op);

as the first line in the hook_user(). I cannot see 'logout' after clicking logging out.

I can see other parameters, like 'login', ...

All I want to do is to clear some stuff after the user logs out. Where else I can do it?

Thanks.

Same problem with Drupal

naudefj - December 30, 2008 - 19:14

Same problem with Drupal 6.8. I hope this can be fixed ASAP.

The problem is with the session destroy

alonpeer - January 12, 2009 - 16:10

When you click logout, the function user_logout() is called. You can see there that it invokes the 'logout' hook.

The problem is that when a user logs out, his session is destroyed, and with it all the messages you set. This is why you can't see your drupal_set_message().

I want to display a message as well and am wondering how to do it...

-------------------
Alon Peer
Web development
http://alonpeer.com

Similar problem

mErilainen - October 21, 2009 - 08:06

I also want to show some content for the user before he logs out or right after logout, but I cannot get anything printed.

I'm using the shib_auth module, so unless I close the shibboleth session in $op == logout, the user stays logged in all the time. What I wish to accomplish is to show the user two links to decide if he wants to logout only from the shibboleth session, or close all SSO sessions.

 
 

Drupal is a registered trademark of Dries Buytaert.