Get List of Session IDs

G

Guest

Hi

Any one know how I get list of Session IDs, I mean all current Session IDs.
Thanks
 
J

John Timney \(ASP.NET MVP\)

on session start add the ID to an application level collection and read
that - and remove the ID on session end.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

Hi John,

That I know it, I want some thing that give me complete list of session IDs?


John Timney (ASP.NET MVP) said:
on session start add the ID to an application level collection and read
that - and remove the ID on session end.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
J

Jeff Evans

MrDotNet said:
That I know it, I want some thing that give me complete list of session

I think he's trying to say there is no implicit way of doing this in
ASP.NET, so you will have to implement it manually if you require such
functionality.
 
T

tomBond

Hi.

This requires a little more effort, though not very much.
First, create new class and make there function for saving sessionid to
database and all the needed logic too to do the database stuff. Create
another function that deletes sessionid from database (takes sessid as
an parameter). Create on more function to get the list of sessionid's
which has been saved to database.
Now, the fun part:
In global.asax you have sub "On_SessionStart". Instantiate a new object
from the class you made for saving and deleting sessionid:s.
Get first the sessionid from the current session and pass it to the
sessionid saving method in your class.
In Global.asax is also sub "On_SessionEnd".
Do exact the same, only this time you use the function that deletes the
sessionid from the database.
Now you have sessionid:s stored in the database and they gets updated
and deleted dynamically as clients enter and leave your application.
To get a list of sessionid:s in the database you have to do a listing
page to get sessionid's listed. Page could be in the same application
that your clients uses, or it can be completely aside from that
application because the data exists in the database.

Hope this helps :)

-tom-
 
J

John Timney \(ASP.NET MVP\)

indeed, session is private to the session. if you want to make the ID's
publically available then you have to cludge it.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
R

Ross Overstreet

Hi MrDotNet,

ASP.NET does have an option to store session state in a SQL Server
database instead of in memory. With real-time session data stored in
SQL Server, you should be able to query the SQL Server database to
determine active sessions.

http://idunno.org/dotNet/sessionState.aspx

Best,

Ross Overstreet
Overgroup Consulting, LLC
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top