Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Multiple Simultaneous logins

I am trying to prevent multiple simultaneous logins in my web application. I want to signout all/any previous authentications of a user when they login. Such that the current login remains the only one.

How do I go about calling FormsAuthentication.SignOut() for a particular user to invalidate any existing authentications.

I have tried searching everywhere but no answers, only theories.

like image 606
Vaibhav Garg Avatar asked Mar 25 '26 03:03

Vaibhav Garg


1 Answers

Well I ended up using the Application state to store the latest sessionid of a user and checking in the master page to see of the session ID matches. If not then the user is signed out.

That way only the latest login is allowed and any previous login is signed out when used.

like image 133
Vaibhav Garg Avatar answered Mar 27 '26 22:03

Vaibhav Garg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!