rbross
You could use Login events and Logout events to record users logging in and out. A LogoutNotification is also sent when the session times out, so when a user closes the browser there is no immediate notification but eventually the session will time out and a LogoutNotification is sent. I am using this to create a log for users logging in and out, the LogoutNotification has the following rule:
IfTESTING_MODE() <> 'Yes'ANDINDEX_OF('BAS_Guest', LogoutNotification.LoginName) = 0ANDLogoutNotification.IsTimeout = 'No'ThenCREATE AuditLogWITHAuditLog.Unit = 'Logout', AuditLog.Message = 'User '+LogoutNotification.LoginName + ' logged out'
ElseIf TESTING_MODE() <> 'Yes'ANDINDEX_OF('BAS_Guest', LogoutNotification.LoginName) = 0ANDLogoutNotification.IsTimeout = 'Yes'ThenCREATE AuditLogWITHAuditLog.Unit = 'Logout', AuditLog.Message = 'User '+LogoutNotification.LoginName + ' session TimeOut'
(The reason for checking TestingMode is that I don’t want to clogg the Log table in my testing environment, and the reason for testing against Bas_Guest is that I experienced that when someone calls the login page, this can already fire the LoginNotification with the Bas_Guest name even though there is no actual login yet.)
I am currently just logging, but with a little effort you could maintain a table of users who are logged in. It would not be 100% accurate because it would still show users who closed their browser but have not yet timed out, but if you set the Session Timeout value to a short period it would be pretty close.