Greetings,
It appears that you have 2 possible scenarios that you will have to handle on the server side to destroy a session.
The first scenario is when the client clicks the "logoff" button. On the server side, you would get the HttpSession object from the request object and then call the invalidate() method on the HttpSession object. See the JavaDoc API documentation (
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html).
The second scenario where the user exits the app without leaving the application in the expected manner of clicking the "logoff" button. This leaves your application not knowing if the user is still there or not (unless you have a short session timeout setting). You need to
test many session timeout scenarios to see what will work and keep your server from running out of memory.
Regards & God Bless,
Tom Pridham
Coastal Software Solutions, Inc.