ASP.NET MVC Session Timeouts, Absolute or Sliding?
Asked Answered
G

1

6

Ref: http://msdn.microsoft.com/en-us/library/vstudio/ms178581(v=vs.100).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

A session is considered active as long as requests continue to be made with the same SessionID value. If the time between requests for a particular session exceeds the specified time-out value in minutes, the session is considered expired. Requests made with an expired SessionID value result in a new session.

I want to make sure I understand that paragraph correctly. From that I read that ASP.NET Sessions work on a Sliding rule, not an absolute rule. That is, a Session will expire 20 minutes after the LAST request to the session (assuming the 20 min default here for argument sake), not absolutely 20 minutes later from the start of the session regardless of request/session activity? I got that right?

Gossipry answered 7/10, 2014 at 1:5 Comment(0)
T
4

Yes you understood it right.

As the docs say each request to the session will reset the 20 min countdown.

Tunny answered 7/10, 2014 at 1:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.