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.
Loading...
Related Quiz
- Your manager wants to prevent users from using their username as their password. Which feature in ASP.NET Core Identity helps with this requirement?
- The ________ template in ASP.NET Core ensures that JavaScript dependencies are managed using the Node package manager.
- To manage application secrets without storing them in the source code, ASP.NET Core introduced the _________ manager.
- Where is the configuration for routes primarily done in an ASP.NET Core MVC application?
- In the earlier versions of ASP.NET Core that used project.json, which section would you look into to find out the target framework(s) for the application?