All online users

All online users

  
Hi guys,

anyone know if there is anyway to know all the logged users in our application?


regards,
Miguel
Miguel

Also something I like to know aswell, how to check user's active/logged in session.

Well i've done my own logic to accomplish my goal.

I've created an entity that stores the online users, OnlineUser, this entity for now only have the UserId and LastActionOn.

Now on every link/button action at the end i put an action called UserActivity and the logic is like:
query the entity and see if the user is already there, if so, update the LastActionOn attribute, is the user isn't there, create it with the LastActionOn as CurrDateTime().

This way I have all the online registered users. But how to know if the user is not anymore in the website?
For this i've scheduled a Timer to run every 5 minute, query the entity OnlineUser with the LastActivityOn more than 5 minutes, and delete them.

Note: This is my way to do it, as a result of some searches on the web. Maybe it can be tweaked or even can exist another and better way to do it.

Regards,
Miguel Antunes