In AJAX applications, using Spring security, handling session time out is a bit tricky. The problem is summarized here. Fortunately with DWR it is easy. DWR provides a way to handle errors, exceptions etc globally. Check more on this here . As mentioned in the doc, you can use ‘textHtmlHandler’ to handle session time out. Here is the snippet,
dwr.engine.setTextHtmlHandler(function() {
//If the current page is secure, Spring security redirects you to login page
document.location.reload(true);
//Or you can set the document.location to your login page.
})
Image may be NSFW.
Clik here to view.

Clik here to view.
