ASP.NET how to logout user all session when password is reset/change

纵饮孤独 提交于 2019-12-11 14:59:44

问题


As an Admin, I am able to reset password for all users. May I know how can I logout the particular users "all" sessions across all devices/PC when I reset his password?

Example:

1) User1 logged in to PC1, PC2 and PC3.

2) Admin reset/change password for User1.

3) System logout session in PC1, PC2 and PC3.

How can it be done in ASP.NET?

Thanks.


回答1:


It is possible , Facebook,G mail are done that , But it is not simple

Use a flag in the database that checks users on Session_Start that invalidates their session if that flag is set. May not necessarily use a boolean, you can use a DateTime value and invalidate all sessions that started prior to that time. This could be done by checking a value stored in a cookie upon login. check the below stackoverflow discussions i think it will help you Check



来源:https://stackoverflow.com/questions/27287875/asp-net-how-to-logout-user-all-session-when-password-is-reset-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!