kill a session?

Y

yabba

w2k server

as webadmin i have occasion to kill a user session and couse them to login
again. I have the sessionID saved in a file.

is there a way to kill the user session without disturbing others?

tia
 
D

Dave Anderson

yabba said:
w2k server

as webadmin i have occasion to kill a user session and couse them to
login again. I have the sessionID saved in a file.

is there a way to kill the user session without disturbing others?

Of course there is, but you may not like the cost.

Assuming you are willing to check the validity of every session on every
page, you can easily compare the Session.SessionID to your list of
disallowed sessions, and call the Session.Abandon() method as needed.

http://msdn.microsoft.com/library/en-us/iissdk/html/06c8fe34-d7e5-469f-a2a8-9bd0570850da.asp
http://msdn.microsoft.com/library/en-us/iissdk/html/02106ee0-6603-4123-b5c8-eeb92ebbbc31.asp

This assumes also that you wipe the list of banned sessions on an IIS
restart, since you'll want to account for the re-use of old SessionIDs.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
E

Egbert Nierop \(MVP for IIS\)

yabba said:
w2k server

as webadmin i have occasion to kill a user session and couse them to login
again. I have the sessionID saved in a file.

is there a way to kill the user session without disturbing others?

tia
SessionID s are not unique :<
So you can't be sure of them.


You can better have them login or create your own unique identifier which
you track in an application variable (as long as you are not in a web farm
this is OK). However, this will cause a lot of performance since each
application variable write causes a temporary lock on the whole website..
Each page, at the top of execution, could check whether it's unique
identifier is in the black-list, if so, it issues session.abandon to itself.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top