user1069516
user1069516

Reputation: 463

Kill a session from another session with .NET MVC3

I use .NET MVC3 framework with razor and my question is simple, how to kill a session from another session ?

I would like to make an admin view with the list of users and the user's session ID and from this view i would add a button or a link which allow me to kill the session of a specific users.

It is possible ?

Thanks for your response

Upvotes: 2

Views: 719

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039248

You could keep a list of logged in users somewhere on the server. Once a user logs in you could add it to your logged in users list. Then you could write a custom Authorize attribute which upon successful authorization will verify if the user is in the list of logged in users and only then allow access. And when under administrator account you could have some action which removes users from this global users list.

Upvotes: 4

Related Questions