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
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"yo********@gmail.com" wrote:
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.