0
votes

In Drupal 6 I want to get the username or user uid when user logged out. I tried with hook_user for logout operation in a custom module but without success. Allways I get the anonymous user.

1
I don't know a way of getting the user id after logged out. I think you can do some work around of putting the user data in cookies/session and use it after logging out. - Emad Samir Zaki

1 Answers

0
votes

Inside hook_user, the account being logged out is accessible in the $account object passed as a function parameter:

hook_user($op, &$edit, &$account, $category = NULL)

The UID can be found in $account->uid and the name in $account->name.