There's no useful purpose to such diatribe. Not everyone has access to the entire
history of this list, nor should they be expected to examine every past post to find
that their problem has been resolved. Besides, I don't think that this problem has
been adequately addressed. The replies have been wide and ranging and some times of no
value whatsoever.
But no one has come to a satisfactory end.
There is one undeniable fact...and that is that there is no "simple" way to tell
wether one has left your site, or that they have quit their browser. There are
however, several techniques that one could employ to deal with the fact that someone
is no longer making requests or that someone has left your site. It all comes down to
how you architect your
application.
One possible solution is to construct an applet and provide a mechanism in the stop()
method of the applet that manages the session object. This applet could have no other
function other than to tell wether some one has left the site. It might be placed in a
hidden frame and provide no user interface.
Another solution is to create a logon/logoff feature and require visitors to either
explicitly logoff. When a person logs off, this action would be captured by a servlet
and dealt with appropriately.
Another solution is to simply rely on a period of inactivity and have their session
become invalidated after that period has expired. This is a technique that most user
authenticated sites employ.
I'm sure that there are other techniques one could use, but it all comes down to
dealing with the inherent limitations of stateless connections and the requirements of
the site.
-ernie
"Craig R. McClanahan" wrote:
> Sandeep Mehta wrote:
>
> > I am trying to write an application with the help of jsdk2.0\javawebserver2.0 and
>i want to track the session.
> >
> > What I am trying to do is that there is a paid web site that allows users
> > to enter the site after allocating him a certain time.He cannot surf beyond that
>time limit.So far so good .I can track the session but my requirment is that if the
>user closes his browser before the allocated time or the internet connection at his
>end fails then I have to calculate the total time surfed by him and accordingly
>update his account.
> > So how do i come to know that browser has been closed or the connection at users
>end has failed.I tried to write a thread that checks every minute
> > if(session==null) System.out.println("logged out");but it does not work.
> > How can the servlet or server come to know when the browser has been closed.
> >
> > Kindly help urgently as my student project hangs on it
> > Many thanks in advance.may contact at [EMAIL PROTECTED]
> >
>
> Doesn't anyone ever read this list before they ask a question that has been
>discussed extensively, including a long thread as recent as the last few days?
>
> Bottom line -- there is no 100% reliable way to do what you're describing.
>
> Craig McClanahan
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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