IRequiresSessionState vs IReadOnlySessionState

前端 未结 3 1589
孤独总比滥情好
孤独总比滥情好 2020-12-01 08:13

What is the difference between IRequiresSessionState and IReadOnlySessionState beside the inability of the second to save changes to the session va

3条回答
  •  天涯浪人
    2020-12-01 08:21

    That interface controls whether the framework will save the current session state at the end of the request. It makes a bigger difference when you're using out-of-process session state storage. In that case, without the interface, the system will still store the session data in the remote database, even when it hasn't changed (the system doesn't keep track of whether the session data was modified during the request). When you use the IReadOnlySessionState interface, the write-back phase is skipped.

提交回复
热议问题