We have a strange problem occurring once in a while on our servers. It usually happens when one or more of our web applications are upgraded. Debugging the problem has gotten me this far...
During the processing of a request:
- In the ASP.NET application we put an object in session
- In code running later (same request) we look up that same session value. It's empty!
So it looks like the session service isn't working, right? This code runs hundreds of times a day, and never fails in development environments or in production situation, only related to upgrading the web application(s) on the web server.
And the strange thing: We haven't really fond a proper way of fixing the situation either. IIS reset, ASP.NET state server stop/start, web.config edits, and even server reboots have all bin used - normally a combination is needed to fix it + plus a lot of swearing and pulling of hears. And in most cases it isn't fixed right away, but maybe two or three minutes after the third IIS reset or whatever. (So it might not be what fixed it after all.)
I'm going crazy here. Any ideas what might be the problem? Is it a microsoft bug?
Some more info:
- We're running under .NET 2.0
- We are using the ASP.NET state service
- The code accessing the session variable and getting back null is in an assembly referenced by the ASP.NET app. It uses the HttpContect.Current to get at the session