G
Guest
I cannot figure out why I'm sporadically losing my session state. I'm
running an app on 3 web servers.
The web server configuration could be a problem. We have 2 servers that
have the application on the D: drive, while the other is on the C: drive
(That's how it was before I got here and we are going to correct this problem
).
I checked the metabase data for IIS. All 3 servers have the same
configuration.
Here is my session state tag from my web.config:
<sessionState mode="SQLServer" sqlConnectionString="data
source=myDB;UID=myID;PWD=myPass"/>
And finally, here is some of the code i use:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' get the user profile from the session
UserProfile = CType(Session("UserProfile"), NWPUserProfile)
' if there is no user profile, kill the session and go back to the
login page
If UserProfile Is Nothing Then
Session.Abandon()
Response.Redirect(Request.ApplicationPath & "/Login.aspx")
End If
' check to see if the user is allowed to view this page
If Not Page.IsPostBack Then
If UserProfile.IsAuthorized(CType(Cache.Get("permissions"),
DataSet), strPage) Then
Me.ltlScript.Text = ""
Else
Response.Redirect(Request.ApplicationPath &
"/Unauthorized.aspx")
End If
End If
End Sub
The part is sometimes it will get past the checks and when the page responds
to (for example) a button click event, the user profile data (which is stored
in session) is gone.
Any help would be greatly appreciated. Thanks.
....sonny
running an app on 3 web servers.
The web server configuration could be a problem. We have 2 servers that
have the application on the D: drive, while the other is on the C: drive
(That's how it was before I got here and we are going to correct this problem
).
I checked the metabase data for IIS. All 3 servers have the same
configuration.
Here is my session state tag from my web.config:
<sessionState mode="SQLServer" sqlConnectionString="data
source=myDB;UID=myID;PWD=myPass"/>
And finally, here is some of the code i use:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' get the user profile from the session
UserProfile = CType(Session("UserProfile"), NWPUserProfile)
' if there is no user profile, kill the session and go back to the
login page
If UserProfile Is Nothing Then
Session.Abandon()
Response.Redirect(Request.ApplicationPath & "/Login.aspx")
End If
' check to see if the user is allowed to view this page
If Not Page.IsPostBack Then
If UserProfile.IsAuthorized(CType(Cache.Get("permissions"),
DataSet), strPage) Then
Me.ltlScript.Text = ""
Else
Response.Redirect(Request.ApplicationPath &
"/Unauthorized.aspx")
End If
End If
End Sub
The part is sometimes it will get past the checks and when the page responds
to (for example) a button click event, the user profile data (which is stored
in session) is gone.
Any help would be greatly appreciated. Thanks.
....sonny