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

7 lines
208 B
C#

[ControllerSessionState(SessionStateBehavior.ReadOnly)]
public class CoolController : Controller {
public ActionResult Index() {
Session["Key"] = "value"; // Value is not available in
the next request
}
}