Jason:
This does it for finding out the last time a uid closed their session.
SELECT uid,timestamp FROM `watchdog` where message like 'Session closed for%'
Jason Flatt wrote:
On Thursday May 3 2007 4:29 am, Haisam Ido wrote:
Thanks Nicolas. But I don't think that would work because by the time that query runs the 'login' field in the 'users' table would have been updated with the latest 'login' time. Is there another table that keeps the history of user logins? I know there must be one since users' logins are logged.
You would probably have to create a custom module and use hook_user to get the login time (from the &$user variable, with either the load, login or update ops) before Drupal has actually logged in the user, and save it somewhere in another database table/field, or using the variable_set/get() functions.