简体   繁体   English

使用表单身份验证时在Classic ASP中注销

[英]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.

相关问题 使用ASP.net中的表单身份验证注销后可以访问页面 - possible to access page after sign out using Forms Authentication in ASP.net 使用asp.net的单点登录表单身份验证不起作用 - Single Sign On using asp.net forms authentication not working 使用基于表单的身份验证在ASP.Net Web应用程序上实现单点登录 - Implement single sign on ASP .Net Web Application current using forms based authentication 没有表单身份验证的ASP.NET MVC 5单点登录模式 - ASP.NET MVC 5 Single Sign On pattern without Forms Authentication 有没有办法使用 Windows 身份验证注销并以其他用户身份登录? [ASP.NET Core 3.1 MVC] - Is there a way to sign out and login as another user using Windows authentication? [ASP.NET Core 3.1 MVC] 在经典 asp.net forms 应用程序中使用 websockets - Using websockets in classic asp.net forms application 使用表单身份验证和ASP.NET时如何通过链接自动对用户进行身份验证? - How to auto-authenticate users via a link when using Forms Authentication and ASP.NET? 使用 OIDC 身份验证方案注销 Blazor 应用程序 - Sign Out of a Blazor App using the OIDC Authentication Scheme ASP.NET Forms身份验证-Chrome和Firefox上的单点登录问题 - ASP.NET Forms authentication - Issue with single sign-on on Chrome and Firefox 经过身份验证的ASP.NET MVC表单身份验证时重定向用户 - redirect user when Authenticated asp.net mvc forms Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM