Clear multiple Sessions

bri189a

Senior Contributor
Joined
Sep 11, 2003
Messages
1,004
Location
VA
If I have a object in each Session out there, how would I go about clear that particular Session object for all Sessions?

I can't find anything that gets all current Sessions, I can always create a collection to track that myself, but I would think .NET already has that built in. Maybe not.

Basically the site has an administrative function that would update some data. This is a small amount of data that varies by user so it is kept in Session - it's root data comes from data that is being changed in this administrative function. The user object was written to reload itself if Session dies while the user is logged in so the user see no interruption. This particular functionallity I'm doing in essense needs to make that Session object die so it reloads with the most current data (via the changed base data that the administrator sets up).
 
You might be better off storing the data in a Cache object instead and specifying a dependency that will cause the data to be expired when underlying DB is modified.
 
That's a good id and then have the object I have in Cache have a property that ties to the Session ID so I can distinguish the data objects (since they vary by user); which will get me the same results.

Next question is how to I do this specifying a dependancy? Quick example?

Thanks.
 
Back
Top