I would add my own custom filter immediately before "CONCURRENT_SESSION_FILTER" and check in the request URI a string like "force -logout.do" (or something similar).
Then, in the generated HTML, I would handle the JavaScript event as follows:
<script type="text/javascript"> function force_logout() { </script> <body onbeforeunload="force_logout();"> </body>
This will work for IE and Firefox (you should also check other browsers). Your filter just needs to check the URI and execute session.invalidate()
if it matches the "URI of failure" and immediately return, or simply bypass the request to the filter chain otherwise.
NOTE. I am not adding AJAX code since I do not know if you are using a specific AJAX structure. With prototype.js, that would be pretty simple.
source share