How to find out all active sessions in the asp.net web server??

  • Thread starter Thread starter Krish...........
  • Start date Start date
K

Krish...........

Hi all,

How to find out no of active sessions (at a time) in the web
server.. I dont think handling Session_start and Session_end events
are useful for this. Is there any way to find all current active
sessions by using Application object ?

Thanx,
Krish....
 
Hi all,

How to find out no of active sessions (at a time) in the web
server.. I dont think handling Session_start and Session_end events
are useful for this. Is there any way to find all current active
sessions by using Application object ?


It can be done via Application level object/collection, each of the
session objects can be counted on Session_OnStart and deleted on
Session_OnEnd. However, Session_OnEnd is unreliable and this approach
(if with no any additional logic, e.g. checking the time expired)
could give you wrong number of session. Because of this, and if you
need to be more accurate, you can add the new sessions in the database
table (sessionID and time) and query this table.
 
Back
Top