enablesessionstate Page directive is needed to use the Session object

Discussion in 'ASP .Net' started by Marco Gerlach, Jul 18, 2003.

  1. 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
    Marco Gerlach, Jul 18, 2003
    #1
    1. Advertising

  2. 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="
    > 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
    >
    >
    >
    >.
    >
    Ravikanth[MVP], Jul 18, 2003
    #2
    1. Advertising

  3. 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


    "Ravikanth[MVP]" <> schrieb im Newsbeitrag
    news:09ab01c34d15$10faf500$...
    > 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="
    > > 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
    > >
    > >
    > >
    > >.
    > >
    Marco Gerlach, Jul 18, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Cheshire [MSFT]
    Replies:
    3
    Views:
    2,296
    Jim Cheshire [MSFT]
    Aug 4, 2003
  2. John Baughman
    Replies:
    6
    Views:
    12,986
    Natty Gur
    Dec 24, 2003
  3. David Lozzi
    Replies:
    3
    Views:
    12,705
    Alvin Bruney [MVP]
    Aug 10, 2004
  4. user_me
    Replies:
    1
    Views:
    577
    Saravana
    Dec 15, 2004
  5. Rick
    Replies:
    0
    Views:
    512
Loading...

Share This Page