ClearData() public static method

Clears all cached data of a session.
public static ClearData ( string sessionId ) : void
sessionId string The session ID.
return void
示例#1
0
        protected void Application_AcquireRequestState(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session != null)
            {
                // This should be performed on EndRequest, but Session is not available there
                SessionCache.ClearData(HttpContext.Current.Session.SessionID);

                // Try to automatically login the user through the cookie
                LoginTools.TryAutoLogin( );
            }
        }