MVC3 vb.net Application using built in session management. I have an mvc3 application that I would like to add being able to see the current number of users online to whether they are logged in or not. I have tried using:
Membership.GetNumberOfUsersOnline.ToString
But that only keeps track of current users logged in which is not acceptable in what I am trying to do. Is there any other method that keeps track of connections????
You could hook on the
Session_StartandSession_Endevents in global.asax. Increase a counter in Session_Start and decrease it in Session_End.Or you can read this article on how to read all users session state via a dirty reflection hack. So you don’t have to count yourself.