views:

1027

answers:

3

We have an application that runs over load balanced server instances, and therefore is configured to use the ASP.NET session state service, which is running on one of our DB servers. While both instances of our app can successfully connect to the state server, changes in session state data are not being reflected across both of them. FI, If I call Session.Add('SomeKey', SomeData) on Server A, this is not being reflected if I then try to access Session['SomeKey'] on Server B.

Session.SessionID returns the same value on both servers, and I have checked that they are both using the same validationkey and decryptionkey values configured in the machinekey section of machine.config. I even tried specifying these values in the apps web.config.

What other things should I be looking out for which may be causing these symptoms, and what steps can people recommend to help debug this issue?

+3  A: 

Does this help:

http://support.microsoft.com/kb/325056 ?

To maintain session state across different Web servers in the Web farm, the application path of the Web site (for example, \LM\W3SVC\2) in the Microsoft Internet Information Services (IIS) metabase must be the same for all of the Web servers in the Web farm. The case also needs to be the same because the application path is case-sensitive.

EJB
Thanks for the link. The app paths are identical (including case). I've tried cloning the IIS configuration from one server to the other, but the problem still remains.
Cleggy
OK, my original 'clone' wasn't deep enough, it would seem. iiscnfg /copy fixed it
Cleggy
+3  A: 

I ended up using iiscnfg /copy to perform a full copy of the IIS metabase from one server to the other, and that resolved the problem. Thanks to E.J Brennan for putting me on the road to glory.

Cleggy
Well then set his answer as the question's selected answer
Andrei Rinea
His answer didn't give the solution to the problem exactly, but as I stated, he prompted me to explore in the right direction. Nevertheless I marked his answer as the accepted one, as he does deserve credit for steering me towards the eventual solution.
Cleggy
A: 

I realize this is an old post, and it was useful when we were trying to fix this very problem on an IIS 6.0 server. However, the details of how a web site and application path are configured is hidden within IIS 7.5, where we are currently having a problem with the ASP.NET Session State service that looks exactly like this problem. Does anyone have any insights as to how to tackle the problem when the web site is hosted by IIS 7.5 (2008 R2) and the session state service is also on 2008 R2?

We are not having connection problems, it just appears that the session cannot be recovered when a user crosses the server boundary.

Brian Jones