invalidate « JSTL « JSP-Servlet Q&A

1. How to invalidate session using JSTL

3. How to detect browser closing to invalidate a jsp session

I theory, you can't do that. The browser does not maintain a connection to the server, so the server has no idea what the browser is doing between posts. I can suggest a possible hack. Add Javascript to the page to detect browser closing. Post a special form whose action field indicates that the browser is closing. This will only work ...