Session Loss
I had an issue with several applications that seemed to just lose session randomly. To combat the issue, I created the session in the start page and gave it the value "". Then, in the controls that required the session, I threw this code in the page load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If Session("SessionName") = Nothing Then
Response.Redirect("Error Page", False)
Exit Sub
End If
Catch
Response.Redirect("Error Page", False)
Exit Sub
End Try
End Sub
|