Session lost in SessionState across requests

Topics: Writing modules
May 31, 2012 at 4:36 PM

Hi,

I've configured stateserver in web.config as well as added a machine key:

 

<sessionState mode="StateServer"
  stateConnectionString="tcpip=localhost:42424"
  cookieless="false"
  timeout="360"/>

 

The stateserver works with other apps running on the same IIS.

In my module I'm using the IHttpContextAccessor to get the current request and setting the session like so:

_httpContextAccessor.Current().Session[_sessionName] = value;

Problem is that in all other requests 

_httpContextAccessor.Current().Session[_sessionName] is null!

It worked fine with InProc StateServer and the connection string looks valid, can anyone advise how I could debug this?

Many thanks,

P.

May 31, 2012 at 5:44 PM

Sorted!

Value was a private class, but unfortunately this was untraceable, no errors or anything.