Does Session timeout reset on every request Does Session timeout reset on every request ajax ajax

Does Session timeout reset on every request


Does Session timeout reset on every request regardless of whether we check sessions variables?

Session will not expire if you keep on calling server side code. The session time out will be resetting on each request to server. On subsequent requests to the same web site, the browser supplies the ASP.NET_SessionId Cookie which the server side module uses to access session value(like user information).

---------------------------------------------------------------------------------                     How to detect the Session TimeOut---------------------------------------------------------------------------------

enter image description here

---------------------------------------------------------------------------------

Question - 2 - Does Ajax request cause resetting session timeout? like Update Panel ,jQuery ajax ,...

Question - 3 - Does HTTP Get cause resetting session timeout??

Session will expire in case user waited too long between requests. Session will not expire if you keep on calling server side code. The session time out will be be resetting on each request to server

Web.Config<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"  sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"    cookieless="true" timeout="1" />


yes, it does. it doesn't matter whether you actually use the Session or not.
However, if you're using only ajax calls, you might run into some problems.
(although I haven't encountered it myself, here's an explanation)


Does Session timeout reset on every request regardless of whether we check sessions variables? Or we should use atleast one session variables?

Until a session variable is established, a new session id is generated for every post back.

Does Ajax request cause resetting session timeout? like Update Panel ,jQuery ajax ,...

Session ID which is saved in the cookie by default, is sent for every AJAX as well as non AJAX request. Hence the server is aware that the session user is active. Don't take my word for it. Use fiddler or the F12 tool within ie. You can see the cookies being sent out with every AJAX GET/POST request.