log out asp.net user through sql?

喜欢而已 提交于 2019-12-13 02:45:21

问题


Can I force a log out through SQL for asp.net membership account?


回答1:


No record of currently logged in users are stored in Forms Authentication mode so it would be impossible to log out a user by some SQL execution alone.

Note that a data store like SQL is only used during the actual credential authentication step of the Forms Authentication lifetime:

Forms authentication control flow http://i.msdn.microsoft.com/Aa480476.formsauth(en-us,MSDN.10).gif

Forms Authentication generally utilizes client-side cookies to handle currently logged in users.

Source: Explained: Forms Authentication in ASP.NET 2.0




回答2:


For forms authentication you can use:

FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();

If you are trying to do this through Windows authentication see this.



来源:https://stackoverflow.com/questions/1909234/log-out-asp-net-user-through-sql

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