List currently logged in users?

Vote:
 

is it possible to list all users currently logged into CMS?

 

Thanks
Danny

#81445
Feb 17, 2014 15:43
Vote:
 

Can anyone help here please?

#81488
Feb 18, 2014 12:00
Vote:
 

I don't think there's an out of the box functionality in ASP.NET that allows you fetch all logged in users.
What you could do is to attach to some of Global.asax events (like Application_AcquireRequestState or something), check if the current user is logged in, and store its name and DateTime.UtcNow into ConcurrentDictionary where the key is IdentityName, and value is DateTime.UtcNow. If the username already exist in the dictionary, then just update the datetime field.
You can store the dictionary into runtime cache (http://msdn.microsoft.com/en-us/library/system.runtime.caching(v=vs.110).aspx) or EPiServer's cache.
Then you need a scheduled job or something, that will remove all users from the dictionary who have been inactive for a minute or something.

You can use http://www.asp.net/signalr to provide real-time statistics to your users.

 

#81493
Feb 18, 2014 12:30
Vote:
 

Nice, I do like the idea of using SignalR to provide real time stats.. that would be quite neat!!

Thanks for the reply

#81494
Feb 18, 2014 12:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.