AspNetCore.Docs/aspnet/whitepapers/mvc3-release-notes/samples/sample13.cs

7 lines
188 B
C#

[ControllerSessionState(SessionStateBehavior.Disabled)]
public class CoolController : Controller {
public ActionResult Index() {
object o = Session["Key"]; // Causes an exception.
}
}