You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alin Simionoiu <as...@musicnet.com> on 2001/05/17 06:18:09 UTC

Browser Closed

Hello everybody,

I'm implementing a login/logout from a web page.
Everithing is absolutly fine if the user it's using my logout button.

But, if the user just close the browser, without using the logout button,
then I'm in trouble.
Has anybody any ideea if is possible to know when a user close the
browser?..

I'm not using a keep-alive connection.
Probably is not possible, considering that http is a stateless protocol.

Alin


Re: Browser Closed

Posted by Alin Simionoiu <as...@musicnet.com>.
Is possible to find out if a specific session is no longer valid?..

----- Original Message -----
From: "Milt Epstein" <me...@uiuc.edu>
To: <to...@jakarta.apache.org>
Sent: Thursday, May 17, 2001 1:15 AM
Subject: Re: Browser Closed


> On Wed, 16 May 2001, Alin Simionoiu wrote:
>
> > I think this event as also fired when you browse thru the
> > pages..wright?..  Want I will really like to have is a SessionEnd
> > event...
>
> Basically ... there isn't a generic, catch-all way to do this, so
> you're going to need to rely on the session timeout mechanism.
>
>
> > ----- Original Message -----
> > From: "Richard Draucker" <ri...@draucker.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Wednesday, May 16, 2001 9:26 PM
> > Subject: Re: Browser Closed
> >
> >
> > > Try clicking the logout button with a javascript triggered
> > > by the <body onunload>.  This is how the porn sites feed
> > > you a zillion popups when you try to get outta their
> > > site... ooops, you weren't supposed to know I know that.
> > >
> > >
> > >
> > > On Thu, 17 May 2001, you wrote:
> > > > Hello everybody,
> > > >
> > > > I'm implementing a login/logout from a web page.
> > > > Everithing is absolutly fine if the user it's using my logout
button.
> > > >
> > > > But, if the user just close the browser, without using the logout
> > button,
> > > > then I'm in trouble.
> > > > Has anybody any ideea if is possible to know when a user close the
> > > > browser?..
> > > >
> > > > I'm not using a keep-alive connection.
> > > > Probably is not possible, considering that http is a stateless
protocol.
> > > >
> > > > Alin
> > > --
> > > Richard Draucker,  richard@protected-data.com
> > > Protected-Data.Com  www.protected-data.com
> > > Remote data support for web developers.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> mepstein@uiuc.edu
>


Re: Browser Closed

Posted by Milt Epstein <me...@uiuc.edu>.
On Wed, 16 May 2001, Alin Simionoiu wrote:

> I think this event as also fired when you browse thru the
> pages..wright?..  Want I will really like to have is a SessionEnd
> event...

Basically ... there isn't a generic, catch-all way to do this, so
you're going to need to rely on the session timeout mechanism.


> ----- Original Message -----
> From: "Richard Draucker" <ri...@draucker.com>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, May 16, 2001 9:26 PM
> Subject: Re: Browser Closed
>
>
> > Try clicking the logout button with a javascript triggered
> > by the <body onunload>.  This is how the porn sites feed
> > you a zillion popups when you try to get outta their
> > site... ooops, you weren't supposed to know I know that.
> >
> >
> >
> > On Thu, 17 May 2001, you wrote:
> > > Hello everybody,
> > >
> > > I'm implementing a login/logout from a web page.
> > > Everithing is absolutly fine if the user it's using my logout button.
> > >
> > > But, if the user just close the browser, without using the logout
> button,
> > > then I'm in trouble.
> > > Has anybody any ideea if is possible to know when a user close the
> > > browser?..
> > >
> > > I'm not using a keep-alive connection.
> > > Probably is not possible, considering that http is a stateless protocol.
> > >
> > > Alin
> > --
> > Richard Draucker,  richard@protected-data.com
> > Protected-Data.Com  www.protected-data.com
> > Remote data support for web developers.
> >
> >
> >
> >
> >
> >
> >
> >
>

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


Re: Browser Closed

Posted by Alin Simionoiu <as...@musicnet.com>.
I think this event as also fired when you browse thru the pages..wright?..
Want I will really like to have is a SessionEnd event...

Alin

----- Original Message -----
From: "Richard Draucker" <ri...@draucker.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, May 16, 2001 9:26 PM
Subject: Re: Browser Closed


> Try clicking the logout button with a javascript triggered
> by the <body onunload>.  This is how the porn sites feed
> you a zillion popups when you try to get outta their
> site... ooops, you weren't supposed to know I know that.
>
>
>
> On Thu, 17 May 2001, you wrote:
> > Hello everybody,
> >
> > I'm implementing a login/logout from a web page.
> > Everithing is absolutly fine if the user it's using my logout button.
> >
> > But, if the user just close the browser, without using the logout
button,
> > then I'm in trouble.
> > Has anybody any ideea if is possible to know when a user close the
> > browser?..
> >
> > I'm not using a keep-alive connection.
> > Probably is not possible, considering that http is a stateless protocol.
> >
> > Alin
> --
> Richard Draucker,  richard@protected-data.com
> Protected-Data.Com  www.protected-data.com
> Remote data support for web developers.
>
>
>
>
>
>
>
>


Re: Browser Closed

Posted by Richard Draucker <ri...@draucker.com>.
Try clicking the logout button with a javascript triggered
by the <body onunload>.  This is how the porn sites feed
you a zillion popups when you try to get outta their
site... ooops, you weren't supposed to know I know that.



On Thu, 17 May 2001, you wrote:
> Hello everybody,
> 
> I'm implementing a login/logout from a web page.
> Everithing is absolutly fine if the user it's using my logout button.
> 
> But, if the user just close the browser, without using the logout button,
> then I'm in trouble.
> Has anybody any ideea if is possible to know when a user close the
> browser?..
> 
> I'm not using a keep-alive connection.
> Probably is not possible, considering that http is a stateless protocol.
> 
> Alin
-- 
Richard Draucker,  richard@protected-data.com
Protected-Data.Com  www.protected-data.com
Remote data support for web developers.









Re: Browser Closed

Posted by Alin Simionoiu <as...@musicnet.com>.
That was a solution that come in my mind also.
But, I don't think you need to build you're own time-out mechanism.
There already one in place.
If you register a SessionBinding listener, you can be notified on
valueUnbound when the session has expire.
I do some testing with the default value for session timeout ( which I think
is 30 sec.) and is working pretty good.
You can modify this value from tomcat setting or from you're code.

BTW, HttpSession has a method named  setMaxInactiveInterval which take as
input a int value.
The problem were is that his method is obsolete, and I think I read some
ware that it doesn't have a replacement...right?

Alin



----- Original Message -----
From: "Devon Ziegler" <de...@channelogics.com>
To: <to...@jakarta.apache.org>
Sent: Monday, May 21, 2001 9:02 AM
Subject: RE: Browser Closed


> I ran into a similar problem.  The servlet sessions will timeout so the
user
> has to log in again, but that doesn't help with what you are talking about
> (which seems to be cleaning up things after a user has been inactive long
> enough).
>
> I basically created a context wide vector of user "sessions" (my own
notion
> of a session, not servlet's) that had inside it the last time a request
was
> received by that user.  Upon any request I update the list for the current
> request (setting the time of last request to now) and clean up any
> "sessions" that have gone beyond my timeout period (which is slightly
longer
> than my servlet session timeout period to be safe).  Admittedly this
cleanup
> will only happen if a request occurs after the user has been inactive long
> enough, but, for me, that was acceptable.
>
> HTH.  -Devon
>
>
>
> -----Original Message-----
> From: Alin Simionoiu [mailto:asimionoiu@musicnet.com]
> Sent: Thursday, May 17, 2001 12:18 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Browser Closed
>
>
> Hello everybody,
>
> I'm implementing a login/logout from a web page.
> Everithing is absolutly fine if the user it's using my logout button.
>
> But, if the user just close the browser, without using the logout button,
> then I'm in trouble.
> Has anybody any ideea if is possible to know when a user close the
> browser?..
>
> I'm not using a keep-alive connection.
> Probably is not possible, considering that http is a stateless protocol.
>
> Alin
>


RE: Browser Closed

Posted by Devon Ziegler <de...@channelogics.com>.
I ran into a similar problem.  The servlet sessions will timeout so the user
has to log in again, but that doesn't help with what you are talking about
(which seems to be cleaning up things after a user has been inactive long
enough).

I basically created a context wide vector of user "sessions" (my own notion
of a session, not servlet's) that had inside it the last time a request was
received by that user.  Upon any request I update the list for the current
request (setting the time of last request to now) and clean up any
"sessions" that have gone beyond my timeout period (which is slightly longer
than my servlet session timeout period to be safe).  Admittedly this cleanup
will only happen if a request occurs after the user has been inactive long
enough, but, for me, that was acceptable.

HTH.  -Devon



-----Original Message-----
From: Alin Simionoiu [mailto:asimionoiu@musicnet.com]
Sent: Thursday, May 17, 2001 12:18 AM
To: tomcat-user@jakarta.apache.org
Subject: Browser Closed


Hello everybody,

I'm implementing a login/logout from a web page.
Everithing is absolutly fine if the user it's using my logout button.

But, if the user just close the browser, without using the logout button,
then I'm in trouble.
Has anybody any ideea if is possible to know when a user close the
browser?..

I'm not using a keep-alive connection.
Probably is not possible, considering that http is a stateless protocol.

Alin