protected void Application_BeginRequest() { if (HttpContext.Current.User != null) //Always null { var aaa = HttpContext.Current.User.Identity.Name; } CarlJonasLeander.ApplicationBeginRequest(HttpContext.Current.Response, this.Context); Log("BeginRequest, URL = " + this.Request.Url.AbsolutePath + ", " + this.Request.HttpMethod); }
protected void Application_EndRequest() { if (HttpContext.Current.User != null) //Never null { var aaa = HttpContext.Current.User.Identity.Name; } CarlJonasLeander.ApplicationEndRequest(HttpContext.Current.Request, this.Context); Log("EndRequest URL = " + this.Request.Url.AbsolutePath + ", " + this.Request.HttpMethod); if (HttpContext.Current.User.Identity.IsAuthenticated && this.Request.Url.AbsolutePath.IndexOf('.') == -1 && this.Request.Url.AbsolutePath.IndexOf("GoBackward") == -1 && this.Request.Url.AbsolutePath.IndexOf("GoForward") == -1 && this.Request.Url.AbsolutePath.IndexOf("Log") == -1) { CachedResponseWrapper cachedResponseWrapperObj = CachedResponseWrapper.GetCachedResponseWrapperObj(); if (cachedResponseWrapperObj != null) { CarlJonasLeanderOutputFilterStream filter = (CarlJonasLeanderOutputFilterStream)this.Context.Items["filter"]; string response = filter.ReadStream(); cachedResponseWrapperObj.CachNewResponse(response); int returnCode = this.Response.StatusCode; } } }