New Session with each page change

Discussion in 'ASP .Net' started by Tim F, Aug 18, 2005.

  1. Tim F

    Tim F Guest

    I can not persist a Session across page changes. I have it configured
    as follows:

    * VS .NET 2002
    * [machine.config]
    <pages buffer="true" enableSessionState="true" enableViewState="true"
    enableViewStateMac="true" autoEventWireup="true"/>

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


    * [web.config]
    <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"/>

    * enableSessionState is True for all pages.

    * All pages use ADO.NET.

    I observe that Global.Session_Start is called with every page switch,
    so I assume a new Session object is being created; however, each new
    Session object is created with the same SessionID. This happens
    whether cookieless is true or false.

    Is there anything else I should look for? Could ADO.NET be conflicting
    somehow? Is this a known VS.NET 2002 issue?

    Thanks,

    Tim
    Tim F, Aug 18, 2005
    #1
    1. Advertising

  2. A new Session object is created when you open the browser, and that same one
    is used until the browser is closed. Global.Session_Start is called when the
    Session is started, not each time a page is requested. If you are looking
    for an event that is called each time a page is requested, you want
    Global.Application_BeginRequest. If you are looking for a way to end the
    current session and start a new one without closing the browser, try looking
    at Session.Abandon(). Hopefully something here will help you. Good Luck!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Tim F" <> wrote in message
    news:...
    >I can not persist a Session across page changes. I have it configured
    > as follows:
    >
    > * VS .NET 2002
    > * [machine.config]
    > <pages buffer="true" enableSessionState="true" enableViewState="true"
    > enableViewStateMac="true" autoEventWireup="true"/>
    >
    > <sessionState mode="InProc"
    > stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10"
    > sqlConnectionString="data source=127.0.0.1;user id=sa;password="
    > cookieless="false" timeout="20"/>
    >
    >
    > * [web.config]
    > <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"/>
    >
    > * enableSessionState is True for all pages.
    >
    > * All pages use ADO.NET.
    >
    > I observe that Global.Session_Start is called with every page switch,
    > so I assume a new Session object is being created; however, each new
    > Session object is created with the same SessionID. This happens
    > whether cookieless is true or false.
    >
    > Is there anything else I should look for? Could ADO.NET be conflicting
    > somehow? Is this a known VS.NET 2002 issue?
    >
    > Thanks,
    >
    > Tim
    >
    Nathan Sokalski, Aug 20, 2005
    #2
    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. Edward Yang
    Replies:
    4
    Views:
    648
    Chris Cummings
    Jul 8, 2003
  2. Mike Kline
    Replies:
    7
    Views:
    10,084
    Dakota
    Jan 13, 2009
  3. Rolf Welskes
    Replies:
    3
    Views:
    530
    Steven Cheng[MSFT]
    Oct 12, 2006
  4. albertly
    Replies:
    3
    Views:
    14,007
    Steven Cheng[MSFT]
    Feb 8, 2008
  5. TonyV
    Replies:
    19
    Views:
    740
    Mark Clements
    Mar 19, 2007
Loading...

Share This Page