Programmerzzz
Programmerzzz

Reputation: 1287

Does session timeout renewal after the last request made or not?

This could be a very basic and easier question but I want to learn. As I understand, default ASP.NET Session timesout after 20 mins. So, what happens if the user postbacks to the server in 15th min? will the session of the user be 5 more minutes or will be 20 more minutes from the time of postback(15+20=35mins from Start)? This renewal of session happens everytime server is pinged by user!

If I am right, Session timeout is the period after which ASP.NET can terminate the user session if it hears nothing, meaning no postback. This made me think of the above question.

Upvotes: 5

Views: 1579

Answers (2)

Brendan Green
Brendan Green

Reputation: 11914

The session timeout uses a sliding expiration - that is, as you described, the session timeout resets after each request.

If the client remains idle for the timeout period, the session will then expire.

Reference:Session State

Quote:

Specifies the number of minutes a session can be idle before it is abandoned. The timeout attribute cannot be set to a value that is greater than 525,601 minutes (1 year) for the in-process and state-server modes.

Upvotes: 4

Nisarg Shah
Nisarg Shah

Reputation: 61

yes you are right. Session expires 20 mins after the last request made.

Upvotes: 0

Related Questions