8

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
  • 419
  • 1
  • 5
  • 13

3 Answers3

11

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

Community
  • 1
  • 1
mboldt
  • 1,780
  • 11
  • 15
  • Thanks for the information and links. They were useful. I will try and see if it works out. – Anutosh Datta Oct 23 '12 at 09:17
  • 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? – Unbreakable Jan 25 '17 at 16:25
0

If you are using Forms authentication you should make sure your FormAuthentication Cookie is set to expire at the same time as your Session.

If not make sure your IIS is not getting recycled. ( put a logger in your Global.asax to verify the application end events compared to your users complaints.)

AMember
  • 3,037
  • 2
  • 33
  • 64
0

It is not enough to set session time out in your web config. If the server on which your site is hosted is having less time out value set in IIS setting, your session is time out according to the server session time out value.

also if you are deleting any folder from the server directory, this can also cause your AppPool to recycle unexpectedly.

so please check the server session time out value and if it less then ask your hosting to increase it as per your requirement.

RVD
  • 66
  • 1
  • 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 Jan 25 '17 at 16:24