SaaS CMS has officially launched! Learn more now.

List currently logged in users?


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



Feb 17, 2014 15:43

Can anyone help here please?

Feb 18, 2014 12:00

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 ( 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 to provide real-time statistics to your users.


Feb 18, 2014 12:30

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

Thanks for the reply

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.