Mickey Patel
Mickey Patel

Reputation: 341

How to fix Session timeout issue?

We have a Struts 2 application. Our javascripts issues automatic, periodic polling requests (Ajax), in order to keep the view up-to-date.

Unfortunately this prevents sessions from timing out...

Is there a way to tell server that some URL shouldn't affect session timeouts?

Namely if for the last 30 minutes, the browser requested nothing but "http://server/autoRefresh.do" , then Tomcat should assume the user went away from the computer, and kill the session.

Upvotes: 1

Views: 1482

Answers (1)

vivekdubey
vivekdubey

Reputation: 510

You can use scheduler to forcefully destroy session after 30 minute if you store session creation time. You can start a scheduler on application start up and it will check the sessions which are older than 30 minute will be invalidated.

Upvotes: 1

Related Questions