RE: Browser Closed

2001-05-21 Thread Devon Ziegler

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:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 12:18 AM
To: [EMAIL PROTECTED]
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

2001-05-21 Thread Alin Simionoiu

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 Sent: Thursday, May 17, 2001 12:18 AM
 To: [EMAIL PROTECTED]
 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

2001-05-21 Thread Nael Mohammad

Talk to me about your other secrets, I do love the sounds of your laugh,
this Crazy Dog, is hungry now, so im getting a tuna sandwich for lunch
today, what do you think? Do you have any other things on your mind today
that I should no of? 

Oh well, it looks like 4 of the people who were from our company did not
show up after all yesterdays race,  I don't feel too bad now. 

What does Sylvia do with all her time during the day?

-Original Message-
From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 11:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Browser Closed


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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 Sent: Thursday, May 17, 2001 12:18 AM
 To: [EMAIL PROTECTED]
 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

2001-05-17 Thread Milt Epstein

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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 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,  [EMAIL PROTECTED]
  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)
[EMAIL PROTECTED]




Re: Browser Closed

2001-05-17 Thread Alin Simionoiu

Is possible to find out if a specific session is no longer valid?..

- Original Message -
From: Milt Epstein [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  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,  [EMAIL PROTECTED]
   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)
 [EMAIL PROTECTED]





RE: Browser Closed

2001-05-17 Thread William Kaufman

javax.servlet.http.HttpServletRequest.isRequestedSessionIdValid().

-- Bill K.


 -Original Message-
 From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 17, 2001 11:34 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Browser Closed
 
 
 Is possible to find out if a specific session is no longer valid?..
 
 - Original Message -
 From: Milt Epstein [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   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,  [EMAIL PROTECTED]
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)
  [EMAIL PROTECTED]
 
 



Re: Browser Closed

2001-05-17 Thread Alin Simionoiu

Corect.
But this is true for existing session.
Want I'm trying to find is something like : isSessionValid(Session)

Alin

- Original Message - 
From: William Kaufman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 17, 2001 1:11 PM
Subject: RE: Browser Closed


 javax.servlet.http.HttpServletRequest.isRequestedSessionIdValid().
 
 -- Bill K.
 
 
  -Original Message-
  From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, May 17, 2001 11:34 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Browser Closed
  
  
  Is possible to find out if a specific session is no longer valid?..
  
  - Original Message -
  From: Milt Epstein [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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,  [EMAIL PROTECTED]
 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)
   [EMAIL PROTECTED]
  
  
 




Re: Browser Closed

2001-05-17 Thread Bip Thelin

On Thu, 17 May 2001, Alin Simionoiu wrote:

 Corect.
 But this is true for existing session.
 Want I'm trying to find is something like : isSessionValid(Session)

If you look at the session interface you can see that there's a method
that does this. session.isValid().

/**
 * Return the codeisValid/code flag for this session.
 */
public boolean isValid();

..bip





RE: Browser Closed

2001-05-17 Thread William Kaufman

If you got an HttpSession from HttpServletRequest, and you didn't invalidate
it yourself, then it's valid.  There's no session you can get which isn't
valid.

Maybe you mean whether it's new?  Call HttpSession.isNew() for that.

Or whether you invalidated it?  You could call isNew() for that, too, and
catch the IllegalStateException it would throw for an invalid session.

-- Bill K.


 -Original Message-
 From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 17, 2001 2:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Browser Closed
 
 
 Corect.
 But this is true for existing session.
 Want I'm trying to find is something like : isSessionValid(Session)
 
 Alin
 
 - Original Message - 
 From: William Kaufman [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, May 17, 2001 1:11 PM
 Subject: RE: Browser Closed
 
 
  javax.servlet.http.HttpServletRequest.isRequestedSessionIdValid().
  
  
 -- Bill K.
  
  
   -Original Message-
   From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, May 17, 2001 11:34 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Browser Closed
   
   
   Is possible to find out if a specific session is no 
 longer valid?..
   
   - Original Message -
   From: Milt Epstein [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 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,  [EMAIL PROTECTED]
  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)
[EMAIL PROTECTED]
   
   
  
 



Re: Browser Closed

2001-05-16 Thread Richard Draucker

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,  [EMAIL PROTECTED]
Protected-Data.Com  www.protected-data.com
Remote data support for web developers.











Re: Browser Closed

2001-05-16 Thread Alin Simionoiu

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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,  [EMAIL PROTECTED]
 Protected-Data.Com  www.protected-data.com
 Remote data support for web developers.