Refresh ASP.net session after default timeout

I need to refresh my old session if the session timeout exceeds the default 20 minutes. Are there any session updates in ASP.net?

+1


source to share


4 answers


If you resume a session after it expires, and when it expires, you refresh it, which you really do, since it doesn't expire at all.



Why not just extend your session in 20 minutes? Is this conditional?

+3


source


I had a similar problem a while ago and found this article very helpful - at least in overcoming part of the problem.

I also added the following line to the defribulator page to prevent caching and it works great for us.



Basically it does an invisible postback (session resume) shortly before the expiration date - we actually do this a little earlier.

Hope this helps, but I can dig up some of the code I used if you want to take a look.

+3


source


One way to do this is to write a JS function that fires at some interval. This function will make an asynchronous call (AJAX) to the server to save the session. This way the session will not time out. This is one of the ways that I know and have seen.

+1


source


Not really. At least not after the expiration date.

The most common thing I've seen is periodically send a "PING" Ajax request. Just something to access the server and restart the timeout for the session.

Jeff wrote about this some time ago.

+1


source







All Articles