Listing online users


I need to list all of the users currently logged into my application.
I’ve dug around and it looks like the best approach is to use database
based sessions and query the session table.

Is the best way? I assume I’ll have to handle users that have closed
their browser where their session hasn’t expired. Are there any other
issues I’ll need to be aware of?


Yup thats probally your only option, as with PStore sessions there is no
way you could consume that information back into the application.

Otherwise just mark a boolean in the users table as to weather or not
there logged in, and have a sweeper to expire there session and change
the value after inactivity.