コード例 #1
0
 public static void Logout(HttpSessionStateBase session, HttpResponseBase response)
 {
     var module = FederatedAuthentication.SessionAuthenticationModule;
     module.DeleteSessionTokenCookie();
     module.SignOut();
     session.Abandon();
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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();
        }
コード例 #4
0
ファイル: AccountHelper.cs プロジェクト: nissafors/Bibblan
 /// <summary>
 /// Clears the session of all indexes & variables
 /// </summary>
 /// <param name="session"></param>
 public static void ClearSession(HttpSessionStateBase session)
 {
     session.Clear();
     session.Abandon();
 }
コード例 #5
0
ファイル: SessionHelper.cs プロジェクト: ju2cho7/aerodrome
 internal static void destroy(HttpSessionStateBase session, HttpResponseBase response)
 {
     session.Clear();
     session.Abandon();
     response.Cookies.Remove("PaydromeUserLogin");
 }
コード例 #6
0
 public void SignOut(HttpSessionStateBase session)
 {
     formsAuthentication.SignOut();
     session.Abandon();
 }
コード例 #7
0
ファイル: SessionManager.cs プロジェクト: vuchannguyen/lg-py
 /// <summary>
 /// Destroy
 /// </summary>
 /// <param name="sessionState"></param>
 public static void Destroy(HttpSessionStateBase sessionState)
 {
     sessionState.Abandon();
 }