Session time out setting in ASP.Net

32,850

The session will be lost when the ApplicationPool recycles. That's one of the IIS settings that you mentioned. To set only the timeout in the web.config will not be enough. You need to adjust the setting in IIS.

Here is a link I found while I was looking into the same problem.

Also, this question was very useful: Losing Session State

Share:
32,850
Anutosh Datta
Author by

Anutosh Datta

Updated on July 14, 2022

Comments

  • Anutosh Datta
    Anutosh Datta almost 2 years

    I have set session time out to 9 hours in web.config file something like this:

    “<sessionState mode="InProc" timeout="540" />
    

    But often users complain that they are facing time out in less than 9 hours of inactivity and the time interval after they are timed out also varies.

    I was wondering if session time out is dependent on any of the below settings in IIS:

    1. Session time setting
    2. Idle- time out setting for Application pool
    3. Recycling setting.

    Please advise. Also, how do I check session time out setting in IIS 7.0?

  • Anutosh Datta
    Anutosh Datta over 11 years
    Thanks for the information and links. They were useful. I will try and see if it works out.
  • Unbreakable
    Unbreakable over 7 years
    Web.config is more like GUI for the server right? So, when we make changes to Web.Cofig we are bascially making changes in settings of IIS Server right? What do yu mean by your site is hosted is having less time out value set in IIS setting
  • Unbreakable
    Unbreakable over 7 years
    Web.config is more like GUI for the server right (so to speak)? So, when we make changes to Web.Cofig we are bascially making changes in settings of IIS Server right?