Enable / disable session state per controller / action method

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

Why are there two incompatible session state types in ASP.NET?

In ASP.NET MVC abstractions over the classic HttpContext objects Request, Response, Session were introduced. They represent abstract classes and are exposed all over the MVC framework to hide the underlying context and simplify the unit testing because abstract classes can be mocked. For example for the session object you have HttpSessionStateBase and its implementation HttpSessionStateWrapper. … Read more

IRequiresSessionState vs IReadOnlySessionState

One critical difference is that IRequiresSessionState puts an exclusive lock on the current session, thereby potentially limiting the # of concurrent requests from the current user. (For more background on this locking phenomenon, see Is it possible to force request concurrency when using ASP.NET sessions?) In contrast, IReadOnlySessionState does not acquire an exclusive lock. This … Read more