Search code examples
asp.net-mvcasp.net-mvc-5.1

SessionState in ASP.NET MVC Application


I have an ASP.NET MVC application. I have the following:

<sessionState timeout="60" />

My question is that if a user goes on a page and takes more than 60 minutes to fill out all the fields on the page, will that constitute a timeout? What constitutes a timeout? Does a user need to go through different pages so timeout will not happen?


Solution

  • Simple answer is - Yes, a person taking more than the timeout (60 minutes in your example) on the same page would cause a timeout.

    Session is server side, so if no requests are sent to the server for the timeout period - the session will expire and all the saved session variables will be lost.

    To complicate things a little bit, if your page is making AJAX calls to the server - those could keep the session alive without navigating to a different page.