ASP.net Membership Freelance user (as administrator)

I am looking for a way to cancel an ASP.net membership session for a specific user. The reason I do this is because of the administrator, I want to delete the user. This works well, but if the user already has an active session, he is still marked β€œonline” until that session dies (I check every time using Current.User.Identity.IsAuthenticated).

How can I kill a session based on the user he authorized. That way, when I do Memberships.DeleteUser (username), I can also execute Session.KillByUser (username)

Thank you in advance


I finished my sentence and used the following method for anyone who has the same problem: http://www.chillaxen.com/2011/02/asp-net-force-a-user-offline-as-admin-destroy -a-session-by-username /

+4
source share
2 answers

How about adding an HttpModule that catches the PostAuthorizeRequest event: check the user credentials for a global list of identifiers that you want to β€œdestroy." If there is a match, kill the user session.

+1
source

As Jacob Or suggested, you can try this ... in the Global.asax check if the registered user is in the "list of users to be made offline" and then log out using forms authentication or deleting the cookie.

0
source

Source: https://habr.com/ru/post/1338539/


All Articles