I have created an ASP.NET MVC 5 App.
I try to access to a session variable in the _layout.cshtml view.
The code is the following one :
@{ var user = Session["idUser"];}
The problem is that the error is
Cannot resolve symbol 'Session'
When I define the session variable in my controller it works.
Session["idUser"] = idUser;
Can I access to the Session variable in the view ? If not why ?