0

Is it possible to configure multiple sessionState in my web.config?

<sessionState mode="StateServer"
                stateConnectionString="tcpip=127.0.0.1:42424"
                cookieless="false"
                timeout="20"/>
<sessionState   mode="SQLServer"
                stateConnectionString="tcpip=127.0.0.1:42424"
                cookieless="false"
                timeout="20"/>

If done so, what may be the implications?

If you are asking why do I want to do that, don't. It was done like that.

Just want to know if it is possible (it is clearly and there is no error). Will it use the first? the second? both? none?

Thanks

SergioM
  • 1,595
  • 1
  • 15
  • 27

2 Answers2

0

No, it's impossible. If you set multiple session state. It will raise error:

Config section 'system.web/sessionState' already defined. Sections must only appear once per config file. 
Brando Zhang
  • 22,586
  • 6
  • 37
  • 65
0

It's not possible, like Brando says, but you could get around this by implementing your own SessionState-provider or, depending on the requirements, using a HttpModule and modifying the session object in the HttpContext.

Jørgen T
  • 11
  • 4