You can retrieve the current user's "session id" from the
HttpSessionBindingEvent e using "e.getSession().getId()". Use this value to
look up an entry in your hastable and remove it.
The HttpSessionBindingEvent is generated when the session is invalidated
(valueUnbound())  or created (valueBound()).

For more details read the Java doc on HttpSessionBindingEvent. Make sure
your class maintaining the hashtable implements the
javax.servlet.http.HttpSessionBindingListener interface.

Regards,
Guus

----- Original Message -----
From: "Rakesh" <[EMAIL PROTECTED]>
To: "Jon Crater" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 12:01
Subject: Re: session ids


> do u have an example
>
>
>  Rakesh Ayilliath
>
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "Jon Crater" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, August 16, 2001 10:27 PM
> Subject: Re: session ids
>
>
> > rakesh--
> >
> > you can solve this problem by having the class responsible for managing
> the
> > hashtable of session ids implement HttpSessionBindingListener.  fill out
> the
> > valueBound(HttpSessionBindingEvent event) and
> > valueUnbound(HttpSessionBindingEvent event) methods so that the
> appropriate
> > session id is added/removed when the hashtable manager is unbound from
the
> > session.
> >
> > jon
> >
> >
> > ----Original Message Follows----
> > From: "Rakesh" <[EMAIL PROTECTED]>
> > Reply-To: "Rakesh" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> > Subject: Re: session ids
> > Date: Thu, 16 Aug 2001 22:12:50 +0530
> >
> > Hi Greg,
> >
> > I know that this sessioncontext api is currently deprecated.
> > I require this for a very specific reason. When I log-in a user,
> > I save his loginID and the sessionId in a static hash table.
> >
> > and when he is logged out, I remove it. Each time someone tries
> > to log-in, I check in to the hash to see if he is already logged in and
> > display appropriate error messages to him.
> >
> > When he logs out by clicking on a logout.do, I remove his
> > loginID from the hash and invalidate his session. Now what happens; if
> > he just closes the browser window, or if his session is timed out ?
> > How do I remove his name from the Hash ?
> >
> > Kindly help.
> >
> >   Rakesh Ayilliath
> > [EMAIL PROTECTED]
> >
> >
> >
> > ----- Original Message -----
> >    From: Greg Maletic
> >    To: [EMAIL PROTECTED] ; Rakesh
> >    Sent: Thursday, August 16, 2001 9:54 PM
> >    Subject: RE: session ids
> >
> >
> >    I don't believe you can get all valid sessionIDs from the server.  I
> > think the API for doing so was deprecated a while back for security
> reasons.
> >   The way I've solved this in the past was to have each session register
> > itself into a application-scoped hashmap, and maintain that map myself.
> >
> >    --Greg
> >
> >
> >     -----Original Message-----
> >    From:
> [EMAIL PROTECTED]
> >
>
[mailto:[EMAIL PROTECTED]]O
> n
> > Behalf Of Rakesh
> >    Sent: Thursday, August 16, 2001 12:28 AM
> >    To: [EMAIL PROTECTED]
> >    Subject: session ids
> >
> >
> >      Hi ,
> >
> >      Is there anyway I can get all valid session ids from the server ?
> >
> >
> >       Rakesh Ayilliath
> >      (Software Engineer)
> >
> >      Synergy IT Innovations Pvt Ltd,
> >      #196, 1st Floor, 9th Cross,
> >      HMT Layout, RT Nagar
> >      Bangalore 560032
> >
> >      [EMAIL PROTECTED]
> >
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
> >
> >
>

Reply via email to