Ok, so I really think I am doing this right, but the cookies aren't being cleared.
Session.Clear();
HttpCookie c = Request.Cookies["MyCookie"];
if (c != null)
{
c = new HttpCookie("MyCookie");
c["AT"] = null;
c.Expires = DateTime.Now.AddDays(-1);
Request.Cookies.Add(c);
}
return RedirectToAction("Index", "Home");
When the redirect happens, it finds the cookie again and moves on as though I never logged out. Any thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…