ASP SessionId

Discussion in 'ASP General' started by Dave, Jan 22, 2004.

  1. Dave

    Dave Guest

    Hi all, we are implementing WSDPro here for load
    balancing. So, when someone comes in they may get
    redirected to www1.domain.com, www2.domain.com, etc. When
    they first come in, they hit www.domain.com, and then get
    redirected to 1, 2, 3 , etc. The problem is, in our
    solution, we are setting a session variable before the
    redirect, and are losing it as the SessionID is changing
    because it is acting like we are changing servers. It is
    my understanding that the SessionID is really just a
    cookie, and since other cookies can have their domain
    changed, this one should as well. Something
    like .Domain=".domain", which should handle everything in
    from of the domain. We ahve tried to change this in the
    Global.asa and got a "you can't do this error", 162 I
    believe.

    Does anyone have any ideas as to how we can change the
    domain of the SessionID to get around this problem? I
    hope I explained it well enough, and thanks in advance.

    Dave
    Dave, Jan 22, 2004
    #1
    1. Advertising

  2. Dave

    Mark Schupp Guest

    Sessions cannot be transferred between server in traditional ASP because
    session data is stored in memory on the originating server. The session
    cookie just contains an identifier (and the identifier is not unique across
    servers).

    There are a number of alternatives (including 3rd-party session replacement
    components).

    Is the user actually re-directed to another server (URL change in browser
    address box, all subsequent requests go to a specific server) or will the
    browser always see www.domain.com?

    If the user is actually re-directed then put your session data in hidden
    form elements and rebuild the session on the target server.

    If load-balancing takes place on each request then you will need to use an
    alternative session mechanism. Typically the alternative is to set your own
    session cookie containing an index into a session data table in a database.
    Each page that requires session data extracts it from the database.

    You can find more discussion of this on www.aspfaq.com or search any ASP
    info site for "web farms" or "session handling"

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Dave" <> wrote in message
    news:256c01c3e108$0fefaf20$...
    > Hi all, we are implementing WSDPro here for load
    > balancing. So, when someone comes in they may get
    > redirected to www1.domain.com, www2.domain.com, etc. When
    > they first come in, they hit www.domain.com, and then get
    > redirected to 1, 2, 3 , etc. The problem is, in our
    > solution, we are setting a session variable before the
    > redirect, and are losing it as the SessionID is changing
    > because it is acting like we are changing servers. It is
    > my understanding that the SessionID is really just a
    > cookie, and since other cookies can have their domain
    > changed, this one should as well. Something
    > like .Domain=".domain", which should handle everything in
    > from of the domain. We ahve tried to change this in the
    > Global.asa and got a "you can't do this error", 162 I
    > believe.
    >
    > Does anyone have any ideas as to how we can change the
    > domain of the SessionID to get around this problem? I
    > hope I explained it well enough, and thanks in advance.
    >
    > Dave
    Mark Schupp, Jan 22, 2004
    #2
    1. Advertising

  3. Dave

    Dave Guest

    Thanks Mark, that is what I had pretty much found out
    myself, just hoping (and wishing actually) that there may
    be another alternative. Unfortunately that is not the
    case, but I appreciate the input either way. Thanks again,

    Dave.
    >-----Original Message-----
    >Sessions cannot be transferred between server in

    traditional ASP because
    >session data is stored in memory on the originating

    server. The session
    >cookie just contains an identifier (and the identifier is

    not unique across
    >servers).
    >
    >There are a number of alternatives (including 3rd-party

    session replacement
    >components).
    >
    >Is the user actually re-directed to another server (URL

    change in browser
    >address box, all subsequent requests go to a specific

    server) or will the
    >browser always see www.domain.com?
    >
    >If the user is actually re-directed then put your session

    data in hidden
    >form elements and rebuild the session on the target

    server.
    >
    >If load-balancing takes place on each request then you

    will need to use an
    >alternative session mechanism. Typically the alternative

    is to set your own
    >session cookie containing an index into a session data

    table in a database.
    >Each page that requires session data extracts it from the

    database.
    >
    >You can find more discussion of this on www.aspfaq.com or

    search any ASP
    >info site for "web farms" or "session handling"
    >
    >--
    >Mark Schupp
    >Head of Development
    >Integrity eLearning
    >www.ielearning.com
    >
    >
    >"Dave" <> wrote in

    message
    >news:256c01c3e108$0fefaf20$...
    >> Hi all, we are implementing WSDPro here for load
    >> balancing. So, when someone comes in they may get
    >> redirected to www1.domain.com, www2.domain.com, etc.

    When
    >> they first come in, they hit www.domain.com, and then

    get
    >> redirected to 1, 2, 3 , etc. The problem is, in our
    >> solution, we are setting a session variable before the
    >> redirect, and are losing it as the SessionID is changing
    >> because it is acting like we are changing servers. It

    is
    >> my understanding that the SessionID is really just a
    >> cookie, and since other cookies can have their domain
    >> changed, this one should as well. Something
    >> like .Domain=".domain", which should handle everything

    in
    >> from of the domain. We ahve tried to change this in the
    >> Global.asa and got a "you can't do this error", 162 I
    >> believe.
    >>
    >> Does anyone have any ideas as to how we can change the
    >> domain of the SessionID to get around this problem? I
    >> hope I explained it well enough, and thanks in advance.
    >>
    >> Dave

    >
    >
    >.
    >
    Dave, Jan 22, 2004
    #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. alien2_51

    Re: Debugging -- SessionID and ASP.Net

    alien2_51, Jul 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    488
    Rob Teixeira [MVP]
    Jul 24, 2003
  2. CQL
    Replies:
    2
    Views:
    2,138
    Colin Young
    Aug 11, 2003
  3. Ronald
    Replies:
    6
    Views:
    6,907
    Andy Mortimer [MS]
    Feb 23, 2004
  4. Rob Meade

    ASP.Net [2.0] - SessionID

    Rob Meade, May 13, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    7,114
    Yanis
    Sep 25, 2008
  5. =?Utf-8?B?SWJyYWhpbS4=?=

    Recyling of sessionID in ASP.NET 2.0

    =?Utf-8?B?SWJyYWhpbS4=?=, Jun 12, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,402
    =?Utf-8?B?SWJyYWhpbS4=?=
    Jun 13, 2006
Loading...

Share This Page