We are using short polling in Jquery to periodically send ajax requests to server to check if there are any updates on the server. polling works fine but because of this, session is always kept active. And the session never gets timedout unless user manually logsout or closes the browser. This can be achieved by setting timeout in polling itself but we want to handle timeout logic in server side.
Is there any way to keep the session idle during these ajax calls. Or we need to handle the timeout manually.
We are using tomcat as application server, spring mvc for view and controller. I have set the session timeout as soon as the new session is created.
session.setMaxInactiveInterval(7200); //2hrs
Any help in this regard is appreciated.
Thanks, Ekanath
You can not configure am ignore URL for the HTTP Servlet container session management. (There is only one setting in session-config of web.xml: session-timeout) You need to implement your own timer and invalidate session when it is required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With