Posted on: 7/23/2015 5:45:37 PM | Views : 847

I need to implement a solution to prevent concurrent logins with the same account in a web application.
I found this blog post and decided to use that as a basis for my solution: http://geekswithblogs.net/Frez/articles/preventing-a-user-from-having-multiple-concurrent-sessions.aspx
Instead of using an HttpModule, I put an event handler "Application_OnPostAuthenticateRequest" in the Global.asax.
Here's the basic gist:
A user logs into the site and an FormsAuthentication ticket is issued. I want to insert a Guid value in the UserData property of the authentication ticket, so in a method that gets called after the FormsAuthentication ticket is issued, I grab the auth cookie, decrypt the ticket, create a new Guid, store the G ...

Go to the complete details ...