3
Reply

How do you sign out from forms authentication?

Swati Agarwal

Swati Agarwal

10y
1.9k
0
Reply

    FormsAuthentication.SignOut(); this method is used for sign out from forms authentication.

    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 { }}

    The FormsAuthentication.Signout() method is used to sign out from the forms authentication.