A
Andy Fish
Hi,
In my asp.net 2.0 application (which uses internal session state), I
wanted to put in a screen so that the system administrator could see
who was logged on and kick users off by killing their session if they
wanted.
By putting all the session objects into a global cache, I found out I
am able to access session variables from other sessions with no
problem. However, calling Session.Abandon() on any session other than
the current one doesn't seem to have any effect - the Session_End
event in global.asax is never triggered and the user can continue to
work as normal.
On closer inspection, it seems that each page request creates a new
HttpSessionState object but that all the HttpSessionState objects for
the same session (i.e. with the same session id) share the same
container of session state objects. calling Abandon on a session,
simply sets the Abandoned flag to true for that session object (i.e.
not for other session objects with the same session id).
Any thoughts of a good way to implement the ability to kill another
session? At the moment I'm thinking that I need to have another global
variable (or session variable) that gets switched by the 'kill'
feature and then at the top of each page I will check whether the
session has been killed by the administrator.
Andy
In my asp.net 2.0 application (which uses internal session state), I
wanted to put in a screen so that the system administrator could see
who was logged on and kick users off by killing their session if they
wanted.
By putting all the session objects into a global cache, I found out I
am able to access session variables from other sessions with no
problem. However, calling Session.Abandon() on any session other than
the current one doesn't seem to have any effect - the Session_End
event in global.asax is never triggered and the user can continue to
work as normal.
On closer inspection, it seems that each page request creates a new
HttpSessionState object but that all the HttpSessionState objects for
the same session (i.e. with the same session id) share the same
container of session state objects. calling Abandon on a session,
simply sets the Abandoned flag to true for that session object (i.e.
not for other session objects with the same session id).
Any thoughts of a good way to implement the ability to kill another
session? At the moment I'm thinking that I need to have another global
variable (or session variable) that gets switched by the 'kill'
feature and then at the top of each page I will check whether the
session has been killed by the administrator.
Andy