Override session object?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Corey

    Override session object?


    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

    #2
    Re: Override session object?

    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" <jcorey@nospamc harter.net> wrote in message
    news:elSHVS8KEH A.1612@TK2MSFTN GP12.phx.gbl...[color=blue]
    >
    > 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![/color]


    Comment

    • John Saunders

      #3
      Re: Override session object?

      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" <kspencer@takem pis.com> wrote in message
      news:el$aPc8KEH A.2488@TK2MSFTN GP10.phx.gbl...[color=blue]
      > 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" <jcorey@nospamc harter.net> wrote in message
      > news:elSHVS8KEH A.1612@TK2MSFTN GP12.phx.gbl...[color=green]
      > >
      > > 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![/color]
      >
      >[/color]


      Comment

      • Jim Corey

        #4
        Re: Override session object?


        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!

        Comment

        • John Saunders

          #5
          Re: Override session object?

          "Jim Corey" <jcorey@nospamc harter.net> wrote in message
          news:euJwGb$KEH A.3596@TK2MSFTN GP10.phx.gbl...[color=blue]
          >
          > 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.[/color]

          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



          Comment

          • Kevin Spencer

            #6
            Re: Override session object?

            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.saunder s at SurfControl.com > wrote in message
            news:#VCWJoILEH A.3664@TK2MSFTN GP10.phx.gbl...[color=blue]
            > "Jim Corey" <jcorey@nospamc harter.net> wrote in message
            > news:euJwGb$KEH A.3596@TK2MSFTN GP10.phx.gbl...[color=green]
            > >
            > > 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.[/color]
            >
            > 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
            >
            >
            >[/color]


            Comment

            Working...