WCF service and force time out after certain interval RRS feed

  • Question

  • User88744855 posted

    in asp.net after authentication if we stay idle for more than 20 minute then session goes time out or expire. so i like to know is there anything similar exist in wcf that when any client will consume my service and when they are stay idle after authenticated more than 20 minute then session should expire and as a result client need to provide credential again.

    just for security reason how could i design our wcf service that when client will call my service and successfully authenticated but after authentication they do not interact with service for more than 20 minute then when client back and interact then he/she will get message like "your session expire....login again"

    guide me to develop this kind of wcf service. thanks

    Thursday, May 8, 2014 10:04 AM


  • User-417640953 posted

    Hi mou_inn,

    Thanks for the post.

    As for the Wcf session time out, I think you should note the binding's timeout like below.

    "There are a number of timeout settings available in WCF bindings. Setting these timeout settings correctly can improve not only your service’s

    performance but also play a role in the usability and security of your service. The following timeouts are available on WCF bindings:

    OpenTimeout, CloseTimeout, SendTimeout, ReceiveTimeout".

    On the server side, ReceiveTimeout used by the Service Framework Layer to initialize the session-idle timeout which controls how long a session can be idle before timing out.


    And there is an example "How to change WCF session time out value", you can refer it for deep understanding.


    And there are lots of threads about wcf session idle, you can also take it online. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 11, 2014 10:15 AM