Interviews4 answers
How do you sign out from forms authentication?
4 Answers
[Authorize]
public ActionResult Logoff()
{
FormsAuthentication.SignOut();
Session.Abandon();
return RedirectToAction("Index", "Home");
}
Shiv Ratan KumarPosted Jun 3, 2019, 7:46 PM EDT
FormsAuthentication.SignOut();
this method is used for sign out from forms authentication.
Munesh SharmaPosted Apr 4, 2014, 1:14 AM EDT
protected void btnLogout_Click(object sender, EventArgs e)
{
try
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cookies.Clear();
Session.Abandon();
//HttpContext.Current.Session["ownerpanel"] = null;
//HttpContext.Current.Session.Abandon();
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
}
catch { }
}
Dileep Kumar PatelPosted Apr 2, 2014, 3:55 AM EDT
The FormsAuthentication.Signout() method is used to sign out from the forms authentication.
Swati AgarwalPosted Mar 29, 2014, 4:49 AM EDT



