0

The session is always Null inside of my controller in MVC 5. Accessing it via Controller or HttpContext it is still null. I have read also read the post like the one below where you can add the sessionState module to the web config but that does not work for me. Any ideas?

System.Web.HttpContext.Current.Session


Controller.Session

ASP.NET MVC - Session is null

Community
  • 1
  • 1
Shiloh
  • 1,816
  • 4
  • 24
  • 29
  • where in your controller? – DLeh Jan 22 '15 at 05:11
  • Can you share more details about your project and controller code. I created a new MVC app in VS2012 and can see Session.SessionID and HttpContext.Session.SessionID is returning successfully in AccountController. – SBirthare Jan 22 '15 at 05:25

1 Answers1

3

In the web.config the sessionState was set to Off. I changed it to InProc and the session is no longer null

Shiloh
  • 1,816
  • 4
  • 24
  • 29