I basically need to restrict the number of logged in users in my application. What I am doing is using Membership.GetNumberOfUsersOnline()
I am getting the number of logged in users while authenticating a new user I check the number of online users to the number I want to restrict.
Membership.GetNumberOfUsersOnline() works fine when a new user logs in, the problem occurs when a user signs out the value of Membership.GetNumberOfUsersOnline() does not automatically decrements. I searched over the msdn and found that this method checks the last user activity time, which doesnt support signout event.
Is there any other way in Membership providers to restrict the number of users.
I am using Silverlight and REST services. I am using Membership.GetNumberOfUsersOnline() at the server side.
Thanx in advance.
Add a new column named status in your user table in data base.The data type of that status column bit (1/0).In every 15 min check no of users are online. Use a Timer in code behind page.Check the timer and in every 15 min raise that paricular event