enablesessionstate Page directive is needed to use the Session object

  • Thread starter Thread starter Marco Gerlach
  • Start date Start date
M

Marco Gerlach

Hello,

on IIS6 running on Win2003 server std. I get this error

"enablesessionstate Page directive is needed to use the Session object"



my web.config looks like this:

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>
<pages validateRequest="false" enableSessionState="true"/>


my machine.config like this:

<pages buffer="true" enableSessionState="true"
enableViewState="true"
enableViewStateMac="true" autoEventWireup="true"
validateRequest="true" />
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
stateNetworkTimeout="10"
sqlConnectionString="data source=127.0.0.1;Integrated
Security=SSPI"
cookieless="false"
timeout="20"
/>


The defaults should be ok ?

If I Set
enableSessionState="true"
at page level, it works, but we have 1200 Pages so my goal is to use
the default settings from web.config. Where else can I look ?


Thanks,

Marco
 
Hi Marco

Try the following way:

<configuration>
<system.web>
<pages buffer="true"
enableSessionState="true"/>
</system.web>
</configuration>


HTH
Ravikanth
-----Original Message-----

Hello,

on IIS6 running on Win2003 server std. I get this error

"enablesessionstate Page directive is needed to use the Session object"



my web.config looks like this:

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;user id=sa;password="
 
Hi Ravikanth,

in my settings enableSessionState in machine.config and web.config was set
to "true".

I added "buffer"=true but i didn't help.

Do you know other settings ?

Thanks,

Marco
 
Back
Top