How to enumerate sessions?

  • Thread starter Thread starter Arsen Vladimirskiy
  • Start date Start date
A

Arsen Vladimirskiy

Hello,

Is there a way to enumerate (or iterate through) all the current sessions of
an ASP.NET application?

For example, I want to write a file current-session.aspx that will tell me
the number of currently connected sessions and will also show me that
information about the data that is stored in all those sessions?

Thanks,
Arsen
 
Arsen,

I think that if you want to access this information, you will have to
use a performance counter (if it exists) in ASP.NET. However, if you are
^IN^ ASP.NET, then I doubt you will be able to get any information out of
the other sessions, as that would constitute a security risk.

If you just need raw numbers on the number of sessions, then check the
ASP.NET performance counters. There should be something there.

Hope this helps.
 
Arsen Vladimirskiy said:
Hello,

Is there a way to enumerate (or iterate through) all the current sessions of
an ASP.NET application?

For example, I want to write a file current-session.aspx that will tell me
the number of currently connected sessions and will also show me that
information about the data that is stored in all those sessions?


In your Global.asax, each time a session starts, add that session to a
global list. When it it ends, remove it.

David
 
Back
Top