It seems to me that has problems in itself: if the user opens a new window on
the same location, then closes the first one, the session will have been
invalidated. Possibly you can communicate between applets across browser windows
so that only the last one to close sends the signal?
Or what if the user hits the 'back' button then goes down a different branch -
should the signal be sent then? As there is no way of knowing what the users
going to next, he may either go down a different branch of come back to your
page.
Sure it may be possible to do this and cover all the bases, but is it really
worth it? You could just set a low timeout (say 2 minutes) for automatic session
invalidation and effectively the same result is achieved.
- simon
Ted Neward wrote:
> A reliable method is to embed an applet on the page, and inside of its
> "stop" method send a signal back to the server that the page is closing
> (browser is closing, or the user is moving on to another page). According to
> the JDK 1.2 dox for java.applet.Applet,
>
> "Called by the browser or applet viewer to inform this applet that it should
> stop its execution. It is called when the Web page that contains this applet
> has been replaced by another page, and also just before the applet is to be
> destroyed. "
>
> That's about the best that I can see that you can do, though.
>
> Ted Neward
> Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here
> http://www.javageeks.com/~tneward
> "I don't even speak for myself; my wife won't let me." --Me
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html