I have an asp.net 1.1 application that i cannot get to work on 2 clustered boxes
(wlbs)
Both boxes use a separate box as the stateserver (service not sql db) and when only one is in the cluster both boxes work fine (saving session data, reading it, doing what they should etc etc).
the problems start when both boxes are in the cluster, it seems when going between the boxes the session data cannot be read and the application throws an error (which is caught in the app, basically if the method can't read the session data it returns false and then the page displays a custom error page saying session has timed out).
I've googled a lot on this problem and found articles about making sure the validationkey is the same in both machine.configs (which i've done) i've also made sure the iis metabase is the same on both boxes, all to no avail.
I've been at a loss on what to do for ages so today i thought i'd write a simple test application that will sit on both boxes, in the cluster testsesh.aspx saves a string to the session, then redirects to readsesh.asp which response.writes the session to the screen so i can see if it can pass session state between boxes outside of our big app.
here is the code for testsesh.aspx
here is the code for readshesh.aspxCode:Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If IsPostBack Then Else Dim i As Integer 'add something to the session Session.Add("testOne", ConfigurationSettings.AppSettings("message")) 'just read out the contents of the session to make sure there is something in there Response.Write("<br />Contents of session on " & System.Environment.MachineName.ToUpper & "<br />") For i = 0 To Session.Count - 1 Response.Write(Session.Item(i)) i = i + 1 Next Response.Write("<br />End of contents of session<br />") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strRedirectPath As String strRedirectPath = ConfigurationSettings.AppSettings("pageone") & "readsesh.aspx" Response.Redirect(strRedirectPath) End Sub
putting both boxes in the cluster i browse to testsesh.aspx. it adds the string from the config to the session. reads out the session. then on the button click redirects to readshesh.aspxCode:Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim i As Int16 Response.Write("Contents of session of " & System.Environment.MachineName.ToUpper & "<br />") For i = 0 To Session.Count - 1 Response.Write(Session.Item(i)) i = i + 1 Next Response.Write("<br />End of contents of session<br />") End Sub
Unfortunately tho i can't get this to work. if i happen to browse to box A for testsesh.asp then when it redirects it still goes to box A for readshesh.aspx it never seems to go to box B.
Please, if anyone has any ideas what can be wrong or what i need to do to sort this out i would be really grateful as this is a complete pain in the arse.




Reply With Quote