How to use sessions in an ASP.NET MVC 4 application?

后端 未结 5 1433
离开以前
离开以前 2020-11-22 17:02

I am new to ASP.NET MVC. I have used PHP before and it was easy to create a session and select user records based on the current session variables.

I have looked ev

5条回答
  •  失恋的感觉
    2020-11-22 17:57

    You can store any kind of data in a session using:

    Session["VariableName"]=value;
    

    This variable will last 20 mins or so.

提交回复
热议问题