0

I have InProc SessionState enabled for my MVC appplication

<system.web>
    ...
    <sessionState mode="InProc" cookieless="false" timeout="180" />
    ...
<system.web>

I have four independent VM's (Dev, Test, UAT & Prod) and unfortunately it does not work on one of them, e.g TempData is not passed between redirects.

I have checked...

  1. IIS machine.config
  2. IIS web.config
  3. Applcation's web.config
  4. Application pool settings

and they are all the same (alllowing for differences in connection strings etc)

Anything else I can check or any ideas as to what might be going on?

Paul Hatcher
  • 7,342
  • 1
  • 54
  • 51
  • If you're having 4 VMs, you cannot use InProc for session state storage because it's stored in the IIS process memory. And since each request randomly hit different VM, the session data won't be there 75% of the time. Either use some form of 'stickiness' (so that the user would always return to the same VM) or go for a distributed session storage (like SQL or other providers). – haim770 Aug 19 '15 at 09:51
  • Sorry this is not a cluster, these are four separate VMs (Dev, Test, UAT and Prod). They all work fine except the UAT environment which is giving the problems - updated the question for clarity – Paul Hatcher Aug 19 '15 at 11:35

1 Answers1

0

My dev and test environments are using the machine names whereas we have configured CNAMEs for the UAT environment as the end users are interacting with the server.

The problem was the hostname of the server... reporting_uat.xxx.com

As this contains an underscorre, IE will not store cookies, see Issue with Session and Cookie in Internet Explorer for websites containing underscore

Community
  • 1
  • 1
Paul Hatcher
  • 7,342
  • 1
  • 54
  • 51