I am trying to migrate a Classic ASP app onto a Windows 2008 R2 server.

The application features run fine, but I am having issue with session.

The application keeps the logged in user information in session and I am constantly getting knocked out as if the session had expired.

While debugging I have discovered the sessions are not expiring but instead I am getting 2-3 different Session IDs in use by one browser.

I am outputting Response.Write(Session.SessionID) on various pages in the application and I can sit there and hit refresh over and over and watch the number changed between these 2-3 SessionIDs randomly.

The sessions are still valid because when I refresh and get the Session ID that I logged in under the page is displayed (because the security check was successful) and when I get one of the other Session IDs I get the "you aren't logged in, you need to log in" message.

If I close and re-open the browser, same story just the set of IDs are new.

This happens with IE8, Firefox and Chrome from multiple computers.

Things I've tried:
- AppPool set to No Managed Code and Classic
- Output Caching set .asp to never cache
- ASP Session Properties enabled and disabled asp session state and confirmed it affected page (error trying to read Session.SessionID when disabled)

Things I've tried just in case but shouldn't have anything to do with ASP Session:
- Disabled compression
- Changed ASP.Net Session State properties (InProc, StateServer, SQLServer, Cookies, URI, etc) -


Check the web garden settings for the app pool. If it's greater than 1, the site will run in more than 1 worker process. Session state in Classic ASP depends on a single instance of the in process memory. It's very rare that the web garden needs to be set to anything other than 1.

A webfarm with round-robin load balancing would have the same issue but your post doesn't suggest that you have that.

  • You are correct sir! As soon as I looked at the setting and saw it was set to 3 I knew you were right and a lot of words I can't type here went through my head. I never touched that so it must be IIS default. – ManiacZX Mar 17 '10 at 18:20
  • Scott-- Thanks for this info! Does this mean that Classic ASP can never run in a web garden on IIS 7? I had an issue with this and had the Session State set to use the State Service, but I was getting the behavior of an in-process state storage. In a high traffic site, it seems Classic ASP could benefit from a web garden too. – MaseBase Apr 23 '10 at 16:54
  • MaseBase, if you are using session state (not everyone does), then a web garden with Classic ASP will cause the issues described. You mentioned the State Service, but that's only for ASP.NET, not classic ASP. The Session State Service isn't affected by web gardens. As long as you are Session State Service with ASP.NET, then a web garden is fine. It's also worth noting that there is almost never a reason to use a web garden. The only situation I know of where it may help is with long running pages that aren't CPU bound where you want extra threads running in parallel. – Scott Forsyth - MVP Apr 26 '10 at 19:12
  • @ScottForsyth-MVP - Is it possible to run an ASP Classic webite which uses session state in a web farm with ARR when ARR is configured with round robin load balancing and sticky sessions? I am having an issue with users picking up random sessions. This only occurs under heavy load. – yuben Jan 27 '15 at 15:46
  • @yuben. ARR with stick sessions should work. Just make sure that you don't have web gardens enabled. And your users are required to use cookies. If your users are picking up random sessions than it may be related to caching. Sometimes pages with dynamic content can be cached, so you should look into caching that may be causing that. Under heavy load there is a greater chance that the page was just cached by another user. – Scott Forsyth - MVP Jan 28 '15 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.