Override session object?

Discussion in 'ASP .Net' started by Jim Corey, Apr 26, 2004.

  1. Jim Corey

    Jim Corey Guest

    I've just learned that the app I've been working on is
    going to be deployed to a web farm.

    The app uses session variables, and I've been told that I want to use
    some other technique.

    I was wondering if there is a way to override the session object so that
    I could leave most of the current code intact. Then
    for the time being I could do what I want in this override section of
    code.

    I only have one page in the app, and this inherits from a base page.

    TIA,
    Jim


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jim Corey, Apr 26, 2004
    #1
    1. Advertising

  2. Use SQL Server to store Session data. The same SQL Server can be assigned
    for all machines in the Web Farm, and you won't have any issues except for
    possible serialization issues with some of the stuff you're storing. When
    using SQL Server to store Sessions, all Session objects must be
    serializable.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Jim Corey" <> wrote in message
    news:...
    >
    > I've just learned that the app I've been working on is
    > going to be deployed to a web farm.
    >
    > The app uses session variables, and I've been told that I want to use
    > some other technique.
    >
    > I was wondering if there is a way to override the session object so that
    > I could leave most of the current code intact. Then
    > for the time being I could do what I want in this override section of
    > code.
    >
    > I only have one page in the app, and this inherits from a base page.
    >
    > TIA,
    > Jim
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Kevin Spencer, Apr 26, 2004
    #2
    1. Advertising

  3. When Kevin says, "use SQL Server", he means that you should set
    <sessionState mode="SQLServer" /> in your web.config.

    --
    John Saunders
    John.Saunders at SurfControl.com


    "Kevin Spencer" <> wrote in message
    news:el$...
    > Use SQL Server to store Session data. The same SQL Server can be assigned
    > for all machines in the Web Farm, and you won't have any issues except for
    > possible serialization issues with some of the stuff you're storing. When
    > using SQL Server to store Sessions, all Session objects must be
    > serializable.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > "Jim Corey" <> wrote in message
    > news:...
    > >
    > > I've just learned that the app I've been working on is
    > > going to be deployed to a web farm.
    > >
    > > The app uses session variables, and I've been told that I want to use
    > > some other technique.
    > >
    > > I was wondering if there is a way to override the session object so that
    > > I could leave most of the current code intact. Then
    > > for the time being I could do what I want in this override section of
    > > code.
    > >
    > > I only have one page in the app, and this inherits from a base page.
    > >
    > > TIA,
    > > Jim
    > >
    > >
    > > *** Sent via Developersdex http://www.developersdex.com ***
    > > Don't just participate in USENET...get rewarded for it!

    >
    >
     
    John Saunders, Apr 27, 2004
    #3
  4. Jim Corey

    Jim Corey Guest

    Well, my intention is not to use sqlserver.
    Evidently the explanation here means that I could go to sqlserver
    without changing the code.

    But I was hoping that I could write my own code to override
    the session object and then save the variables to viewstate or a hidden
    html field in the new code for the override and
    leave the rest of the code intact.

    Jim

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jim Corey, Apr 27, 2004
    #4
  5. "Jim Corey" <> wrote in message
    news:euJwGb$...
    >
    > Well, my intention is not to use sqlserver.
    > Evidently the explanation here means that I could go to sqlserver
    > without changing the code.
    >
    > But I was hoping that I could write my own code to override
    > the session object and then save the variables to viewstate or a hidden
    > html field in the new code for the override and
    > leave the rest of the code intact.


    I'm sure you could do this, but why reinvent the wheel? Microsoft has
    already invented a variety of wheels, and they test them, too!
    --
    John Saunders
    John.Saunders at SurfControl.com
     
    John Saunders, Apr 27, 2004
    #5
  6. In addition to John's excellent advice, a good rule of thumb is, let
    Microsoft manage as much of your stack as possible. Whatever part of your
    stack you build, you have to manage. Whatever part of your stack Microsoft
    builds, they have to manage.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "John Saunders" <john.saunders at SurfControl.com> wrote in message
    news:#...
    > "Jim Corey" <> wrote in message
    > news:euJwGb$...
    > >
    > > Well, my intention is not to use sqlserver.
    > > Evidently the explanation here means that I could go to sqlserver
    > > without changing the code.
    > >
    > > But I was hoping that I could write my own code to override
    > > the session object and then save the variables to viewstate or a hidden
    > > html field in the new code for the override and
    > > leave the rest of the code intact.

    >
    > I'm sure you could do this, but why reinvent the wheel? Microsoft has
    > already invented a variety of wheels, and they test them, too!
    > --
    > John Saunders
    > John.Saunders at SurfControl.com
    >
    >
    >
     
    Kevin Spencer, Apr 27, 2004
    #6
    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. =?Utf-8?B?YmRldmlsZWQ=?=

    Override Session Timeout

    =?Utf-8?B?YmRldmlsZWQ=?=, Feb 17, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    5,009
    =?Utf-8?B?UyBoIGEgdSBu?=
    Mar 16, 2005
  2. lekshmi

    Override session timeout

    lekshmi, Mar 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    597
    Juan T. Llibre
    Mar 7, 2005
  3. =?Utf-8?B?UlVTU0VMTCBNQ0dJTk5JUw==?=

    Need to override session timeout due to page refresh...

    =?Utf-8?B?UlVTU0VMTCBNQ0dJTk5JUw==?=, Mar 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    514
    =?Utf-8?B?RG90TmV0SmVyb21l?=
    Mar 10, 2005
  4. momo898
    Replies:
    2
    Views:
    494
    bruce barker \(sqlwork.com\)
    Oct 12, 2006
  5. lekshmi

    Override Session Timeout

    lekshmi, Mar 3, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    123
    lekshmi
    Mar 3, 2005
Loading...

Share This Page