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( ); } }