Application_EndRequest not finding Session

AllisonB

New Member
I'm trying to set a cookie in Application_EndRequest in Global.asax.vb as suggested hereI've written the folowing code, cookie gets \[code\]ERROR\[/code\] value. Why isn't session available?\[code\]Sub Application_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim context As HttpContext = HttpContext.Current If Not context.Session Is Nothing Then context.Response.Cookies("T").Value = http://stackoverflow.com/questions/13847631/context.Session("T") Else context.Response.Cookies("T").Value = "http://stackoverflow.com/questions/13847631/ERROR" End IfEnd Sub\[/code\]
 
Back
Top