Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Accessing a collection of Session IDs

$
0
0

I am not sure if I am in the correct place to post this, but my primary question is: Does .NET 4.5 provide a class or collection that allows you to access all of the session IDs that are currently active for a specific web application?

To Be specific, I am working with a development project in VS 2013 for Web coded in Visual Basic which is a web application that can allow both anonymous and authenticated user to access certain areas of the application and post comments or questions. To keep certain session specific items separate for each user the application uses individual session subdirectories created on the fly in a 'temp' directory to store some images and other session specific files. The session temp directory is re-created if it does not exist when a new page is loaded, so I have contemplated adding code at some point that will wipe out all the user session temp directories. However, I would rather not put a garbage collection and cleanup routine in with the code that is run during every page load since it could delay loading pages depending on the number of users online.

My idea is to maybe store each session id in the database when a new session is started and set a timer so every so many minutes a routine could be run that retrieves the session ids from the database and then compares them against current live session IDs on the server and then only remove those session temp directories that are no longer live sessions. However I have been unable to discover if there is a way to retrieve a collection of live session IDs from the server.

Is this possible at all?

Thanks,

David



Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>