public static void Logout(HttpSessionStateBase session, HttpResponseBase response) { var module = FederatedAuthentication.SessionAuthenticationModule; module.DeleteSessionTokenCookie(); module.SignOut(); session.Abandon(); }
/// <summary> /// Clears the user session, clears the forms auth ticket, expires the forms auth cookie. /// </summary> /// <param name="session">HttpSessionStateBase</param> /// <param name="response">HttpResponseBase</param> public static void Logoff(HttpSessionStateBase session, HttpResponseBase response) { // Delete the user details from cache. session.Abandon(); // Delete the authentication ticket and sign out. FormsAuthentication.SignOut(); // Clear authentication cookie. HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, ""); cookie.Expires = DateTime.Now.AddYears(-1); response.Cookies.Add(cookie); }
/// <summary> /// Destroys the specified session. /// </summary> /// <param name="session">The session.</param> public static void Destroy(HttpSessionStateBase session) { if (session == null) { return; } session[SessionKey] = null; session.Abandon(); }
/// <summary> /// Clears the session of all indexes & variables /// </summary> /// <param name="session"></param> public static void ClearSession(HttpSessionStateBase session) { session.Clear(); session.Abandon(); }
internal static void destroy(HttpSessionStateBase session, HttpResponseBase response) { session.Clear(); session.Abandon(); response.Cookies.Remove("PaydromeUserLogin"); }
public void SignOut(HttpSessionStateBase session) { formsAuthentication.SignOut(); session.Abandon(); }
/// <summary> /// Destroy /// </summary> /// <param name="sessionState"></param> public static void Destroy(HttpSessionStateBase sessionState) { sessionState.Abandon(); }