Enable / disable session state per controller / action method

后端 未结 2 2126
傲寒
傲寒 2020-12-01 14:41

We are building an ASP.NET MVC application which will be deployed behind a hardware load balancer that supports, among other things, caching.

Our proposal is to manu

2条回答
  •  猫巷女王i
    2020-12-01 14:59

    This is now moved from Futures into MVC3. There's a ControllerSessionState attribute (apparently will be named SessionState for the final release of MVC3), which can be applied to a controller, something like this:

    [SessionState(SessionStateBehavior.Disabled)]
    public class MyController : Controller
    {
     ...
    

    (But in the RC version, you must use ControllerSessionState

提交回复
热议问题