user30803
user30803

Reputation: 875

MVC ASP.NET website logging out earlier than settings show

I have the following config in an attempt to allow the session to be retained for around 239 minutes, however the session is lost in less than an hour.

<system.web>
<sessionState mode="InProc" timeout="240" />
<compilation debug="true" targetFramework="4.0">
  <assemblies>
       ...
  </assemblies>
</compilation>
<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="239" />
</authentication>
<pages>
  <namespaces>
       ...
  </namespaces>
</pages>

I don't believe there to be any C# code overriding these settings.

Does anyone know why this might be happening?

Upvotes: 2

Views: 829

Answers (2)

Rickard
Rickard

Reputation: 2335

you also have an idle time-out setting on the application pool process which is set to 20 minutes by default, e.g. every 20 minutes (if no activity) the app pool is reset which also would throw away any active in-proc sessions.

enter image description here

Upvotes: 3

Related Questions