Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Why are sessions timing out, sessionstate timeout set

Hey I have the following line in my web.config

<sessionState mode="InProc" timeout="45"/>

Which I thought would keep sessions intact for 45 mins

But I have seen the case where if a user is inactive for lets say 15 mins the sessions times out.

How can I stop this ?

Edit : Just noticed I have the following line in the master page

meta http-equiv="Refresh" content="1800;URL=http://www.virtualacademy.ie/login.aspx">

Maybe this is causing the issue, what is the above line doing i.e the number 1800

like image 948
StevieB Avatar asked May 06 '11 14:05

StevieB


2 Answers

Be sure to check your IIS configuration because the application pool that your site is hosted on also has its own timeout value which will override your own .config.

To increase it,

  1. Open IIS
  2. Select Application Pools on the left side
  3. Select the Application Pool used by your site
  4. Choose advanced settings
  5. Under Process Model categtory increase the 'Idle Time-out' value to the desired length.

Hope this helps.

(If you do not have a dedicated server / access to IIS with your hosting provider you will have to contact them to see if they can increase it for you)

like image 81
Despertar Avatar answered Sep 18 '22 13:09

Despertar


If the user closes their browser or clears cookies, or if the AppDomain on the server is recycled, the session state will be lost.

Have you checked logs to see if the app is recycling?

like image 32
Andrew Barber Avatar answered Sep 20 '22 13:09

Andrew Barber