Session timeout… this is the bain of my existence in our classic ASP site. We set it in global.asa, we set it in IIS 6 (properties > home directory > configuration > options tab “enable session state”) we setup the application pool to only recycle when we want it to. But still every now and again we have problems. Maybe the application pool is reaching its memory limit and recycling anyways?
One problem on a clients server took me ages to figure out. We had initially setup IIS 6 from our stock standard documented configuration, no surprises, no bells & whistles, just stock standard. A few months later we started receiving notices that users were being “kicked off” the system and directed to the log in page. Session time out seemed to be the issue here.
So I checked the usual suspects that I wrote above, and these were all set fine. I could not actually reproduce this issue when using my local broswer on the site. After investigating the user’s computer I thought it may be something blocking the asp cookie, or removing it. But this was a dead end. I eventually gave up and focussed my efforts back on the server. But i did end up recording my longest showmypc.com session of 2hours +, hi-5′s all round! The problem ended up being with the application pool, the sys admins had set the multiple process option in the application pool.
DON’T setup classic ASP sites to use a web garden ( > 1 worker processes in the application pool). If you do this, more than one instance of w3wp.exe is started for a given Application Pool. This means two HTTP requests for a given user using the same application within that application pool may be directed to any of the w3wp.exe instances running that application and session data is not shared between w3wp.exe instances because they are separate processes. In the sys admin’s defence they were trying to improve the performance and scalability of the site.
The purpose for this post is to help point other people in the right direction to set what we have setup, and also to get feedback from other developers out there. Got a suggestion for me? Let me know by leaving a comment!




Hi,
Thanks for posting this article here, but can you please help me how should I setup my DefaultAppPool? If possible if you can send me an screenshot of your DefaultAppPool properties. I’m confused if I need to choose 1 or more worker processes in application pool. I need a session timeout of 180minutes.
It’s been my problem for more than a month now.
Have a good day!
Thanks,
Norman
Thanks so much for this. I’ve been battling with my hosting company with my virtually managed servers. The number of times I’ve second guessed my own code and fought this issue – well – lets just say I’m sure I could have taken a nice vacation instead.
I’ll be getting on the horn with them right away and demanding that they look at this instead of simply telling me “the servers are setup properly”. Driving me nuts!