Nate Pet
Nate Pet

Reputation: 46222

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?

Upvotes: 0

Views: 125

Answers (2)

ABlue
ABlue

Reputation: 673

session data is stored for 60 minutes from the last request. So, if you access a page and something is stored as session data for you, it will be automatically removed after 60 minutes unless you have made a new request within this time period. you shouldn't try to use sessions to store data for long periods of time.

Upvotes: 0

jefftrotman
jefftrotman

Reputation: 1114

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.

Upvotes: 1

Related Questions