Getting currently Logged in members

I want to know how many members are currently logged into the given system .

Or in other words i would like to know how many sessions are presently running into my server . how is this possible .

I am trying to do like this .

HttpSession session = req.getSession();

HttpSessionContext context = session.getSessionContext();

Enumeration en = context.getIds();

while(en.hasMoreElements())

{

String s = (String)en.nextElement();

out.println(s);

}

But i dont get any output .

Please somebody guide me .

[585 byte] By [mohitagarwal] at [2007-9-26 1:22:44]
# 1
hiu can add a field in ur master table like status and update the field to 1 whenever the user logs in and to 0 if the user logs out or if the session expireshope this helps ucheerssuri
suri_dev at 2007-6-29 1:00:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
This is fine and i have even tried this . if a user logout by logout link than this is ok we can update the field in database but how to updata field if session expires auotomatically due to time .
mohitagarwal at 2007-6-29 1:00:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Anybody for help .
mohitagarwal at 2007-6-29 1:00:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...