I have a few problems with sessions on my IIS7 and ASP.NET. Even if the session is set to 30 minutes in the IIS Manager on the site, it runs out in less than 5 minutes if I do not click around on the website (administrations system which require login)

Is there anything I am missing on setting up the right session idle time?

Thank you! :-)


Probably has nothing to do with the session but with where the session is stored. By default session is stored in same process (InProc) as application is thus whenever the application pool restarts session is lost. To workaround it you can either save the session state on SQL server or OutOfProc mode which allows you to run separate process on Windows which will only store sessions and will be never recycled without the timeout limits are met.

  • That's a good thing to look at. Additionally, what's causing the recycles in the first place? Might be something there to look into. 'touching' web.config, the bin folder, creating a new folder and other things cause AppDomain recycles (different than Applicaton Pool recycles). Each of those will cause InProc session state to be lost. – Scott Forsyth - MVP Dec 10 '09 at 12:24
  • Cool! I also discovered you can set the idle timeout on the application pool :-) – janhartmann Dec 14 '09 at 9:04

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.