User tracking

December 22, 2003 by Carl Grint

You can have a simply table which has 4 columns, 1 for ID, 2 for UserID, 3 for time logged in, 4 for time logged out

When the User logs in, have the Log in behaviour go to a intermediate page which contains a Command to update this table, Insert the UsersID from your Users table, filtered on the Username (use a recordset to provide this), then the Logged in column set to getdate().
Then use a Redirect to move to the home page, this will happen almost instantly, so the user will not notice.

Then on the log out link/page do the opposite, link to an intermediate page which updates the table, based on the UserID, and simply inserted getdate() into the logged out column.

You can then create a page to query this table to see who is on, and simply only show records where the Logged out column <> "" and < getdate()

Hope this helps

How to track LogOut on window close

April 18, 2004 by Steve V

Hi,

How can you track the LogOut if the user closes the window?

 

Thanks