Lee,
I don't think that it is possible (in the way you might want) to access multiple session objects within the ASP environment. For security's sake, the connected user is bound to the session they use through the SESSIONID generated when they first access the application, which is stored in a temporary session cookie on the users computer.
Although I may be mistaken, I do not believe there to be a collection for session objects (a collection above the built in Session object) - so there is no way to iterate through all the sessions currently active. (you can iterate through the session.contents collection, but that is not what you want)
So we
cannot do this for example:
Application.Sessions(Session.SessionID).LCID
or
Server.Sessions(Session.SessionID).Abandon
Depending on what you are trying to actually do, there are alternative designs and methods that could help you.
For just one variable you could set both the session variable and an application variable with the same value (but the application variable would hold an array rather than a single value)
( Here's how to manage arrays in application & session variables..
)
Or you can add it to a string if you want it really simple:
application("something") = "Value1|Value2|Value3"
myarray = split(application("something"),"|")
(add session id / user id if you need to know which session / user the value belongs to)
This will then give you access to the variable across all users. But for more than one variable, or long/complex information this might not be feasible. If that is the case then I would say you should try using a database to store the session details in.. that way you have full access and control over all sessions.
If you still must access the sessions directly then you may be able to do it using WMI - though how much info you could get from this I'm not sure, and it would require that you logged onto the web application as an administrator.
Here is a link which includes code for some of these examples - in particular the WMI bit - you may be able to extend this to analyse the contents of the session.. maybe not (a bit of a long shot).
I think your best option if you have alot of information to share is the DB method. Though quick and dirty would be the application variable string that you can split into an array - used with the SessionID and the Session_OnEnd event, you should be able to keep this reasonably in check - though be warned that this is not the most reliable method!
There may be some way to directly access other sessions' variables, but it seems unlikely. - If someone else knows, it would be interesting to see.
Hope this helps,
A smile is worth a thousand kind words. So smile, it's easy! 