Viewing Who is online

Y

yossimotro

Hi guys,

I'd like to add a feature of viewing who is online to my website.
Right now whenever a user logs on to my website I create a Session
variable for him containing his ID.
I'd to have some ideas on how to do it.

Thanks,
Yossi.
 
J

Jeff Dillon

Create an Application variable based on the Sessions. Perhaps a hashtable
kept in Application scope?

Jeff
 
G

Guest

Actually what you need here is an Application variable, not a session
variable. Session is specific to that user and so you would have no way to
see it.

You could have either a static Hashtable or an ArrayList in global.asax or
some other class, and In Session_Start in global.asax you could add a new
entry to this. In Session_End, you would remove it.

Be advised that Session_End only fires for InProc session state and is
independent of whether the user still has their browser open or not - it
fires on the server.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top