ASP.Net MVC 5 w/identity 2.2.0 注销不起作用

编程入门 行业动态 更新时间:2024-10-11 19:21:51
本文介绍了ASP.Net MVC 5 w/identity 2.2.0 注销不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在测试 ASP.Net MVC 5 站点(用于 Internet 站点)上使用基本登录.

I am using a the basic login on a test ASP.Net MVC 5 site (for an internet site).

登录工作正常,但当我尝试注销时却没有发生.注销链接确实调用了以下控制器操作:

The login works fine but when I try to logout it doesn't happen. The logout link does call the following controller action:

public ActionResult LogOff() { AuthenticationManager.SignOut(); return RedirectToAction("Index", "Home"); }

但用户保持登录状态.我如何确保用户实际已注销?

But the user stays logged in. How do I ensure that the user actually gets logged out?

推荐答案

我之前也遇到过这个问题,改一下:

I had this problem before, change:

AuthenticationManager.SignOut();

致:

AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);

假设您使用 ApplicationCookie 来存储您的登录信息.

Assuming that you are using ApplicationCookie to store your login information.

更多推荐

ASP.Net MVC 5 w/identity 2.2.0 注销不起作用

本文发布于:2023-11-17 09:03:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   Net   ASP   MVC   identity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!