alphaudarschu
New Member
I have an HTTPModule which I have registered to handle the Application_BeginRequest() event. Whenever I attempt to get a reference to the HTTPSessionState object, it is set to nothing. My snippet of code looks like this:<BR><BR>Sub Application_BeginRequest(ByVal s As Object, ByVal e As EventArgs) <BR>Dim app As HttpApplication = CType(s, HttpApplication) <BR>Dim iSegmentCount As Integer = app.Context.Request.Url.Segments.Length<BR>Dim sURLSegment As String = app.Context.Request.Url.Segments(iSegmentCount - 1).ToString.ToUpper <BR>Dim oSesh As HttpSessionState = app.Context.Current.Session 'Have also tried just app.Context <BR>If Not Ctype(oSesh.Item("UserID"),Long)>0 Then <BR>Return <BR>End If <BR>'Logging code goes here<BR><BR>oSesh is nothing everytime. Can any help?<BR>Thanks<BR>