amirt
March 3rd, 2009, 07:55 AM
Hello all,
I have a problem of infinite loop in my asp.net application in session_start.
it's located in global.asax and the code goes like this:
Try
Dim MyClassVars As MyClassVarsClass = New MyClassVarsClass
If Not HttpContext.Current.Request.Cookies("MaxmindVar") Is Nothing AndAlso HttpContext.Current.Request.Cookies("MaxmindVar").Value <> "" Then
sessionVisitor.InitializeSession(Request, Request.ServerVariables, Session, True, True, HttpContext.Current.Request.Cookies("MaxmindVar").Value)
Else
sessionVisitor.InitializeSession(Request, Request.ServerVariables, Session, True, True, PayoutsVars.MaxMindString)
End If
Catch ex As Exception
Log("MyClass", "SessionVisitor Problem. " & ex.ToString, False)
End Try
MyClassVars.SessionId = "pyhyt" & Session.SessionID
Dim requestedURL As String = Request.Url.ToString
If requestedURL.IndexOf("tid=") = -1 Then
' check if the url has something in the querystring, and handle accordingly
Dim token As String = MyHashing.cmpHashHandler.CreateToken(Session.SessionID)
MyClassVars.Token = token
MyClassVars.MaxMindString = "US"
MyHashing.cmpHashHandler.AddNewRecordToSortedList (token, MyClassVars)
If requestedURL.IndexOf("?") > -1 Then
requestedURL = requestedURL & "&tid=" & token
Else
requestedURL = requestedURL & "?tid=" & token
End If
End If
Response.Redirect(requestedURL)
Response.AppendToLog("SessionStart")
End If
when i run my app. it gets into this loop in this function.
I have the same code exactly in my laptop and no problem there so I guess the different machine may cause the problem, maybe I'm missing something? the iis configuratrion is also the same...
help? :blush:
I have a problem of infinite loop in my asp.net application in session_start.
it's located in global.asax and the code goes like this:
Try
Dim MyClassVars As MyClassVarsClass = New MyClassVarsClass
If Not HttpContext.Current.Request.Cookies("MaxmindVar") Is Nothing AndAlso HttpContext.Current.Request.Cookies("MaxmindVar").Value <> "" Then
sessionVisitor.InitializeSession(Request, Request.ServerVariables, Session, True, True, HttpContext.Current.Request.Cookies("MaxmindVar").Value)
Else
sessionVisitor.InitializeSession(Request, Request.ServerVariables, Session, True, True, PayoutsVars.MaxMindString)
End If
Catch ex As Exception
Log("MyClass", "SessionVisitor Problem. " & ex.ToString, False)
End Try
MyClassVars.SessionId = "pyhyt" & Session.SessionID
Dim requestedURL As String = Request.Url.ToString
If requestedURL.IndexOf("tid=") = -1 Then
' check if the url has something in the querystring, and handle accordingly
Dim token As String = MyHashing.cmpHashHandler.CreateToken(Session.SessionID)
MyClassVars.Token = token
MyClassVars.MaxMindString = "US"
MyHashing.cmpHashHandler.AddNewRecordToSortedList (token, MyClassVars)
If requestedURL.IndexOf("?") > -1 Then
requestedURL = requestedURL & "&tid=" & token
Else
requestedURL = requestedURL & "?tid=" & token
End If
End If
Response.Redirect(requestedURL)
Response.AppendToLog("SessionStart")
End If
when i run my app. it gets into this loop in this function.
I have the same code exactly in my laptop and no problem there so I guess the different machine may cause the problem, maybe I'm missing something? the iis configuratrion is also the same...
help? :blush: