title: How to extend Session Idle Timeout in ASP.NET Core 3.1
body: <p>Current state:
  The session expires after 40 minutes of inactivity, although the session idle timeout is set to four hours in the Startup.cs file.</p>
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
     services.AddSession(options =&gt; {
       options.IdleTimeout = TimeSpan.FromHours(4);
     });
  }
  </code></pre>
  <p>Target state:
  The session should expire after four hours at the earliest.</p>
  <p>I have tried to set the session state timeout in the IIS manager, but it didn't work aswell.</p>
  <p><a href="https://i.stack.imgur.com/YQyud.png" rel="nofollow noreferrer">session state in IIS manager</a></p>