Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net (MVC): Which session timeout is what?

I've made one Asp.net MVC website, and I'm very confused between the different timeout settings.

What is the difference between:

  • SessionState Timeout in web.config:

Web.config sessionState timeout

  • Application pool timeout

Application pool timeout

  • Asp.Net Session timeout property

    Asp.Net Session timeout

Which one should I set if I want to have a timout of (say) 6 hours? All of them? Only some?

like image 483
J4N Avatar asked Sep 07 '12 08:09

J4N


1 Answers

The application pool timeout is the length of time the site has to be idle for before the application pool will shut down the worker process to release resources. The downside is that when the next visitor comes to the website it takes a long time to restart things so that first request after a shutdown will be quite slow. IIS7 Application Pool Idle Time-out Settings

The session timeout refers to the session id that a user gets on first request to the site, and when that expires. I think the ASP one that you've included the screenshot of is for classic ASP, not ASP.NET.

So to increase the session timeout you would use the one in the config file.

There's also a Session state section when you click on the website in IIS that you could possibly use either and there's a timeout at the bottom of the page for it.
But if the value for the application pool timeout is shorter, then your session setting will be irrelevant as the worker process will shut down before the session expires. So you should also change your application pool settings.

Session Time out in IIS 7

like image 167
Nanhydrin Avatar answered Sep 18 '22 07:09

Nanhydrin