我有Logout action
一个控制器:
public ActionResult Logout()
{
FormsAuthentication.SignOut();
Session["UserCredential"] = null;
return RedirectToAction("Index", "Home");
}
这在谷歌浏览器中工作。但是当我在第一次登录和注销后使用我的 web 应用程序和 firefox 浏览器(最新版本)时。当我再次登录应用程序并按下注销按钮时,我无法从 Web 应用程序注销。Request.IsAuthenticated
正在返回我真正的价值。
对于登录,我使用了以下操作:
[HttpPost]
public JsonResult Login(string userName, string password)
{
User oUser = oRepository.GetUser(userName,password);
Session["UserCredential"] = oUser;
if (oUser != null)
{
if (oUser.IsVerified)
{
string url = Request.Url.AbsolutePath;
FormsAuthentication.SetAuthCookie(userName, false);
return Json(new { res = 1, RedirectUrl = Url.Action("Index", "Home") }, JsonRequestBehavior.AllowGet);
}
else
{
return Json(new { res = 0, RedirectUrl = "" }, JsonRequestBehavior.AllowGet);
}
}
return Json(new { res = -1, RedirectUrl = "" }, JsonRequestBehavior.AllowGet);
}
任何人都知道我必须做些什么来解决我的Firefox浏览器问题。