I am writing some applications in symfony 2. I need to get a list of users who are logged in to the application.
You can...
Grab the "onRequest" event and save the user_id timestamp in your database for the last time this happened. (this is updated every time a user clicks a link on your site).
Have your users send heartbeats via AJAX to your server (easily with jQuery) and save the user_id timestamp in your database for the last time this happened. (this is updated at known intervals)
Grab the onSecurityInteractiveLogin event and save the timestamp in your database, delete it when you log out (many users never log out)