How to enumerate sessions?

  • Thread starter Arsen Vladimirskiy
  • 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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
D

David Browne

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
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top