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??
 
Rao.
----- Original Message -----
Sent: Friday, April 28, 2000 14:08
Subject: Re: Listing Active Sessions

 
----- Original Message -----
Sent: Friday, April 28, 2000 8:38 AM
Subject: Listing Active Sessions

Hi All,
 
Could some one tell me how to list all the sessions which are active at a particular instance? I guess the interface HttpSessionContext can be used for this, but API doc says, it has been deprecated with no replacement.
 
Could some one suggest an alternative way out please....??
 
I'm using JavaWebServer 2.0
 
Thanks in Advance.
 
Rao.
 
Hi Rao,
 
There is a good reason why access to other servlets and sessions via the Servlet API
has been deprecated and in most cases deprecated properly, namely security.
 
If you can access them so can anyone one elses Servlets and JSP's which is not a good
thing.
 
You could setup all of your servlets such that session object references are stored
in a central storage object however you may have problems when the server is restarted
(Session objects are quite often persistent) so you would have to have some way of
updating your session reference object each time a session object (via getSesstion methods)
is grabbed from the session pool. While it might seem like a good idea to make your session
reference object persistent as well, it is not because the sesssion objects you would be storing
in your .ser file will no longer be the same session objects that the server restores (it has its
own session store).
 
Just out of interest, why on earth do you need to be able to track all sessions?
 
Andy Bailey

Reply via email to