How to use sessions in an ASP.NET MVC 4 application?
问题 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 everywhere on the Internet for a simple step-by-step tutorial that can show me how to create and use sessions in my C# ASP.NET MVC 4 application. I want to create a session with user variables that I can access from anywhere in my controllers and be able to use the variables in my LINQ queries. -Thanks in advance! 回答1: Try //adding