Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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! :-)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 :-) –  meep Dec 14 '09 at 9:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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