I've been given the task of looking into a problem where the session of a user changes between refreshes of a page. Immediately (not knowing anything about the website) I said that it seems like a load-balancing/web cluster configuration issue. However, I found out later that the website is not load-balanced - It's a single server.
The application has a Basket object which is stored in Session. The user adds items to the basket etc. When on the basket page, if the page is refreshed the items which are in the basket change and sometimes there are none.
The session is not lost, it comes back almost always on the next refresh but then the basket can be empty or have different content on the next refresh. I've seen this behaviour before many times but only on multi-server set-ups.
This is something we have tried to replicate on a developer environment with no success - we simply cannot replicate the problem but on live it happens a lot.
The web application is an ASP.NET WebForms site, running under .NET 4.0 on Windows Server 2008 R2 and IIS 7.5.
Session state mode is InProc and the session timeout is set to 480 minutes.
I've used fiddler to look at the requests and responses and the ASP.NET session ID passed to the server is the same each time. There appears to be no difference between the responses besides the actual HTML returned.
Has anyone got any ideas on what could cause this problem?
I have re-worked some of the logging that a colleague implemented in the basket code. I can now see that the Session ID remains the same, the value of the Session variable also stays the same even though different data is displayed.
Sorry, I should have checked their logging before posting this.
I'm convinced that this is a server issue though, the code works as expected in our testing environment.