[英]Sign out in Classic ASP when using forms authentication
I am working on an application that was originally written in Classic ASP and am converting that application to ASP.NET MVC. 我正在处理最初用Classic ASP编写的应用程序,并将该应用程序转换为ASP.NET MVC。 the users switch between the two sections of the application depending upon what has been converted and what is pending. 用户根据已转换的内容和未决的内容在应用程序的两个部分之间切换。
Here is my question: I have just implemented forms authentication using the membership provider in .Net. 这是我的问题:我刚刚使用.Net中的成员资格提供程序实现了表单身份验证。 I want to know how will I sign out a user from the classic asp side? 我想知道如何从传统的ASP方面注销用户? should I simply redirect a user to a controller action in MVC to call the FormsAuthentication.SignOut()
and Session.Abandon()
methods, or is there a way to sign out a logged in user in Classic ASP? 我应该只是将用户重定向到MVC中的控制器操作,以调用FormsAuthentication.SignOut()
和Session.Abandon()
方法,还是有办法注销Classic ASP中已登录的用户?
Any help will be appreciated. 任何帮助将不胜感激。
There is no 'standard' in classic ASP for designating whether a user is logged-in or not, but in most systems there will usually be some sort of session variable set (ie session("loggedin") or session("userID"), etc.). 经典ASP中没有用于指定用户是否登录的“标准”,但是在大多数系统中,通常会有某种会话变量集(即session(“ loggedin”)或session(“ userID”)等)。 So you could do a Session.Abandon() but that may have the undesirable effect of losing other, non-login related session variables. 因此,您可以执行Session.Abandon(),但这可能会导致丢失其他与登录无关的会话变量的不良后果。 Instead, determine which session variables indicate that a user is logged-in (on the classic ASP side) and remove them from the collection, eg: 相反,确定哪些会话变量指示用户已登录(在经典ASP端)并将其从集合中删除,例如:
session.contents.remove("loggedin")
session.contents.remove("userID")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.