In case of Asp.NET web application, using state server session and web farm; How to restrict user from login multiple times. If user is already logged in, He shouldn't be allowed to login using the same credential from different browser. I have found a link to automatically log out previous session Single Session Enforcement. But the requirement is to keep the first session alive rather than logging him out. whenever second session tries to login, he should get error message stating "User is already logged in".
We have session time out of 20 min.
Thank you in advance.
For this you have to set
IsLoggedinstatus in you DB. While login you have to check this status. If it'struethen user is already logged in. And whilelogoutyou have to change this to false.If user closed the browser
In logout you can check
if (GetUserContext() != null)then changeIsLoggedInstatus.