0

I am using MVC Actionfilter (Global) to call db to get user data and i try to store that in session. Coding as mentioned in Dependency Injection in ASP.net Session_Start method. Everything works fine in local machine.

But in production machine, my filterContext.HttpContext.Session (filterContext being ActionExecutingContext) is always null.

I dont know what more information i can give, but if somebody asks questions I am ready to provide more answers.

Please let me know what i can check.

Community
  • 1
  • 1
Jap Evans
  • 1,097
  • 8
  • 22
  • 42

1 Answers1

1

Adding the below to the web.config fixed the problem, although i dont know why it has to be done.

<system.webServer>
  <modules>
    <remove name="Session" />
    <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
  </modules>
</system.webServer>
Jap Evans
  • 1,097
  • 8
  • 22
  • 42