Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have web application suppose i login form one pc and another person login from another machine.i want to logout another person.please help me?i m using .net 4.5 mvc razor.
Posted
Updated 1-Sep-15 21:36pm
v2
Comments
George Jonsson 2-Sep-15 3:05am    
Not really a well formulated question. More of a "gimmie code" post.
F-ES Sitecore 2-Sep-15 5:15am    
The web is stateless, it doesn't know who else is "logged in" and from where so these things normally aren't possible. It depends on your actual requirements though, which you have poorly explained, and how you are implementing your authentication which you haven't said at all.

1 solution

The solution to this problem depends on a number of factors.
If you are using custom login, you can track the logged user and the session in the database.
If the user is already logged in, send a response to all existing users that someone else has logged in with the same user and then destroy the old session.

Try http://www.sprklab.com/notes/5-how-to-allow-only-one-user-per-account-in-aspnet[^] if the application is hosted on one server only.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900