There are two ways that I know of. One is to put a logout button that the
user MUST click for it to work. Not necessarily a workable solution because
if they dont click it and go to some other site or close the browser, your
code doesn't get called. The other way is to use an applet, a very simple
one, and use the HttpListner interface I believe. Every time a page "leaves"
the applet is killed, and thus notified as to what is going on. However,
this method doesn't guarantee the user has left your site or closed the
browser..this could occur on every page.

I may have misunderstood you and maybe you just want to know when the
session dies? You can implement the HttpListener class on any to all of your
objects and implement the two methods it presents. When the object is
removed from the session, it will call that objects method that HttpListener
promises. Sorry..I don't recall what the names of the methods are, or if the
interface is HttpSessionListner or not. Look in the Servlet 2.1 or 2.2 spec
and you'll see it there. It at least tells you when an object has expired,
so you can do some cleanup in this case.

Hope that helps.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to