How can you configure session timeout for a logged-in user in ASP.NET Core?

  • Set the "SessionTimeout" attribute in the Startup.cs file
  • Use the "app.UseSession" method and configure "SessionTimeout" in services.Configure
  • Use the "app.UseSession" method and configure "IdleTimeout" in services.Configure
  • Set the "SessionTimeout" attribute in the appsettings.json file
To configure session timeout in ASP.NET Core, you should use the "app.UseSession" method in the "Configure" method of the Startup.cs file. The session timeout can be set using the "IdleTimeout" property in the services.Configure method. This middleware enables session state in the application, and configuring the timeout here is the correct approach.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *