----- Original Message -----
Sent: Friday, April 28, 2000 12:01
PM
Subject: Re: Listing Active
Sessions
Hi,
Hi Andy,
Thanks for your
reply...
Ok.. why I need to
list active sessions??, the reason is.. I would like to know how many users
are connected to my server at a given time, and I will have to track
the IP address of the each request where it has come from..
so when ever user logs on
, I'll capture the IP address of that user request and associate it with
the session object.
Can you please suggest me
a work around , how to achive this??
Are You talking about user leaving his session
(by closing the window or log out ) and after that he comes back?
Maybe i am missing something here but as far as i
know the HttpSession object will be invalidated
when the browser is closed. After a while it
will be destroyed by the servlet engine. So if a user
closes the window and than he comes back after a
while even if you track his IP, his session is
very likely destroyed.
And another thing: one IP address is not enough
to track an user (machine) the
request.getRemoteAddr() ussually returns the
proxy IP. So maybe you want to check for some headers too
like "x-forwarded-for".
If i DIDN'T missunderstand You i would
suggest using cookies and implement Your own session like YOU
described.
p.s. Sorry if i missundestood You (please ingnore
this e-mail if so) :)
Andras.
Rao.