session gets lost sporadically

SweatCoder used Ask the Experts™
We have a classic asp web app running on win03/IIS6. The app works correctly on dozens of servers, but when we installed on one customer's hosted server, the session gets lost quite frequently (for all users), about every 5-10 minutes or so.

Session timeout is set to 60 minutes in IIS and is not set any place in the code. Implementations on other servers do not have this problem. Cookies are enabled on client pc's. The session gets lost in various places throughout the app. It's sporadic, not linked to a certain page or a certain user.

I need some pointers as to where I should start looking. How can I troubleshoot this?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Check of the hosted server uses a web farm (i.e. multiple webservers serving the same web pages).  I think sessions are held in the memory of the webserver used the first time the page is viewed, and can get lost if another server serves the page. Depending on how much data needs to be passed around, cookies or hidden input fields are a better way to go.
How to keep the state across servers in a farm.


We're already planning to go to sql-based session management, but for the short term I'd like to resolve this problem. They are not using a farm, it's a single server. This server is dual-processor, but they say they did some tweak to "turn off" the 2nd cpu or something, because we thought that might be the problem. If the 2nd processor/cpu is indeed running, would that screw up session state?

Any other ideas?
I've hosted websites on dual CPU servers before and haven't had this sort of problem on them. It could be worth posting a link to this question in the IIS forum.


I posted a pointer question on IIS section.
You can put a server in single-processor mode for the OS but it's generally the other way around.  You've already installed your OS and the server is not fast enough so you add another processor but it doesn't take advantage of it.  With Windows, you have to tell it to use both.  If the processor is installed prior to OS installation, it will put it in SMP mode (Symmetric MultiProcessing).  I doubt you'll find a Asymmetric MultiProcessing server being used to host a web site but ...

None of this would have anything to do with losing sessions intermittently.
This issue seems to be semi-common, and it has impacted us greatly.  Unfortunately, we've still not gotten to the root cause.  There are many articles posted that regard this issue, with many differing possible causes.  We are working through each possible cause, one-by-one, hoping we'll finally identify the culprit.  The real frustration is that our solution works great on XP Pro running IIS 5.1.  But on Windows 2003 Server running IIS 6.0, our web app. loses state randomly -- sometimes after only a few minutes and sometimes after a couple of hours.  We're also having problems with some frames failing to serve up, but then they're fine if the users right-click inside the frames and manually refresh them.  This is all perplexing to me since Win '03 Server w/ IIS 6.0 is more robust than XP Pro, supposedly.

The following articles (culled from other postings on EE) have been helpful, but I can't say we've conquered this issue yet.  Maybe they'll help you:


Xolutionz, thanks for all the info. This issue plagued us and infuriated our customer to the point that I finally had to rewrite our app such that all session data was stored by sql server, and we took IIS completely out of the picture as far as managing session state was concerned. This solution turned out to be glorious, rock-solid and bulletproof. I recommend it to anyone that has experienced this sickening problem.

[you'd think MS could have architected their session state management to be a *bit* more robust!!]
We are thinking along these lines as well.  The kicker is that our sites running XP Pro/IIS 5.0 are working great, so it would be a re-work of our web solution for sake of the few that are running IIS 6.0.  It probably will happen eventually.  My feeling is that Microsoft should patch IIS to address this specific issue, since they're touting Windows 2003 as their robust web server platform.  Anyway, thanks for the points!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial