0

in web.xml in tomcat we have defined a timeout for our application, when after session timeout it should redirect to login page. What actually happens is this, it does not redirect automatically but after a user action, when the user action occurs the login page is loaded inside an inner div of main screen, instead a redirect.
More info: this is an SPA and we use div elements to load content via AJAX. searched tomcats' official docs and nothing. The same goes when using a filter. Any suggestions to what can cause this ?

user536875
  • 21
  • 1
  • 6

1 Answers1

0

What seems to happen is that your AJAX request is hitting the timeout and gets the login page as a response. Then your client side code is rendering this response (login page) in the inner DIV.
This is a well known issue and I suggest you start by taking a look at this stackoverflow thread which has many suggestions for dealing with session timeout handling for Ajax calls.
Depending on the frameworks you are using in your application, there are also many articles about how to deal with this issue, for example:

Community
  • 1
  • 1
Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57