Title: RE: Invalidating session and closing the connection

Of course!

Unless you embed an applet that creates an active connection to your server (i.e. a socket), the ONLY way to tell if a user has left your site is by session timeout. This is the nature of web technology. There is just no (server side only) way to tell what a user is doing when he/she is NOT sending requests to your server.

Israel

-----Original Message-----
From: Jen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 12:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Invalidating session and closing the connection


When I tested the HttpSessionBindingListener, when the
user close the browser the unBoundValue() is not
called. It is called until the session times out.


--- Nic Ferrier <[EMAIL PROTECTED]> wrote:
> Rajesh said:
>     What we want is:
>     if user closes the browser
>      Or
>     goes to some other  website, either by
> explicitly typing the URL, or
> clicking on browser back
>     and forward buttons, then we want to invalidate
> the session and close
> the connection.
>     So how do I trap the browser close event and how
> do I trap whether the
> user
>     has left the website or not.
>
> This is basic stuff. You just put an object on the
> session which implements
> HttpSessionBindingListener. If you do that your
> listener object will recieve
> an event when the session dies (ie: the user closes
> the browser or has
> surfed on for a significant time). You can then
> obtain the Connection from
> the session and close it.
>
> This has been discussed (about a gazillion times)
> here on this list.
>
> Check the archives and other sites for more details.
>
>
> Nic Ferrier
>
>
___________________________________________________________________________
> 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
>


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

___________________________________________________________________________
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

Reply via email to