What is the default session timeout in ASP.NET MVC and how to change the session timeout value?

  • Nov 15, 2020
  • 1
  • 3.5k

What is the default session timeout in ASP.NET MVC and how to change the session timeout value?

Answers (1)
Answer Accepted

ASP.NET MVC Session state is used to temporarily store and retrieve the values for a user when the user navigates to another view in an ASP.NET MVC application. 

The default ASP.NET MVC session timeout value is 20 minutes. If you want to change the session timeout, then you have to add the below code in the application web.config file

<system.web>   
    <sessionState timeout="30"></sessionState>
</system.web>

For more details about the ASP.NET MVC session timeout, please read this blog How to Increase the Session Timeout in ASP.NET MVC Application.

Submit your answer