Wednesday, August 05, 2009 12:02 PMHello
Do you know how I can retrieve all sessions informations on a WCF application on the server side?
I would like to be able to "kill" the session of a specific client based on his IP or SessionID
Thanks in advance.
Thursday, August 06, 2009 4:10 AMHi Thibaut,
No.. this cannot be done... you cannot "query" external sessions and kill them.
Maybe we can provide further guidance if you explain what are you trying to achive (authenticate/authorize clients based on IP?)
Thursday, August 06, 2009 7:17 AMHi Rodrigo. Thanks for your answer.
My goal is to have a list of all connected users (current sessions) and found the information about these sessions like sessionsid, client IP,... and display those informations to the application manager (human.
My application must be session based with a very long timeout, but for business reasons, I would like to be able to kill a specific sessions before the timeout has been reached and without any call from the client otherwise I could implement the "kill" method has a behavior on the server side.
Thursday, August 06, 2009 12:46 PMHi Thibault,
You may create the list... however you won't be able to close the session without invoking a service operation... you should use the IsInitiating and IsTerminating properties of the OperationContract attribute for that.... you won't be able to "kill" the sessions from outside of the service...
Monday, August 10, 2009 10:40 AMModeratorI agree that it is not quite possible to directly terminate a session(or the service instance related to that session) in service-side(without a method call) from WCF client. According to the WCF instance management and lifetime model, the session and instance relationsthip is maintained internally and the possible means for you to explicitly end a session is accessing the OperationContext.Current.InstanceContext.ReleaseServiceInstance method. See the "Instance Deactivation" section in the following article:
#Discover Mighty Instance Management Techniques For Developing WCF Apps
Please remember to mark the replies as answers if they help and unmark them if they provide no help.