session variable and instances of classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael G

    #1

    session variable and instances of classes

    What are the drawbacks, limitations, etc. of referencing/manipulating an
    instance of an object across calls via a session variable?

    thanks mike



    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
  • Michael G

    #2
    Re: session variable and instances of classes


    "Michael G" <mike-g@montana.com> wrote in message
    news:42cac7ae$1 _2@spool9-west.superfeed. net...[color=blue]
    > What are the drawbacks, limitations, etc. of referencing/manipulating an
    > instance of an object across calls via a session variable?
    >[/color]

    I just noticed one thing that might be an issue. If the php enviroment
    variable session_auto_st art is set to on objects cannot be stored as session
    variables. My question is, is it standard practice to set
    session_auto_st art to 'off'?



    mike



    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

    Comment

    • Alvaro G Vicario

      #3
      Re: session variable and instances of classes

      *** Michael G wrote/escribió (Tue, 5 Jul 2005 12:50:22 -0600):[color=blue]
      > My question is, is it standard practice to set
      > session_auto_st art to 'off'?[/color]

      I only load session data where I'm going to use it. In many sites I build
      sessions are required in 5% of pages.

      --
      -- Álvaro G. Vicario - Burgos, Spain
      -- http://bits.demogracia.com - Mi sitio sobre programación web
      -- Don't e-mail me your questions, post them to the group
      --

      Comment

      • Scott Auge

        #4
        Re: session variable and instances of classes

        In article <42cad766$1_1@s pool9-west.superfeed. net>,
        "Michael G" <mike-g@montana.com> wrote:
        [color=blue]
        > "Michael G" <mike-g@montana.com> wrote in message
        > news:42cac7ae$1 _2@spool9-west.superfeed. net...[color=green]
        > > What are the drawbacks, limitations, etc. of referencing/manipulating an
        > > instance of an object across calls via a session variable?
        > >[/color]
        >
        > I just noticed one thing that might be an issue. If the php enviroment
        > variable session_auto_st art is set to on objects cannot be stored as session
        > variables. My question is, is it standard practice to set
        > session_auto_st art to 'off'?
        >
        > http://us3.php.net/manual/en/ref.session.php
        >[/color]

        I haven't tried it, but can't you serialize() the object, stuff it into
        a session variable, and then get it back later on?

        Comment

        • Tony Marston

          #5
          Re: session variable and instances of classes


          "Scott Auge" <scott_auge@yah oo.com> wrote in message
          news:scott_auge-E2722E.11443020 072005@news1.we st.earthlink.ne t...[color=blue]
          > In article <42cad766$1_1@s pool9-west.superfeed. net>,
          > "Michael G" <mike-g@montana.com> wrote:
          >[color=green]
          >> "Michael G" <mike-g@montana.com> wrote in message
          >> news:42cac7ae$1 _2@spool9-west.superfeed. net...[color=darkred]
          >> > What are the drawbacks, limitations, etc. of referencing/manipulating
          >> > an
          >> > instance of an object across calls via a session variable?
          >> >[/color]
          >>
          >> I just noticed one thing that might be an issue. If the php enviroment
          >> variable session_auto_st art is set to on objects cannot be stored as
          >> session
          >> variables. My question is, is it standard practice to set
          >> session_auto_st art to 'off'?
          >>
          >> http://us3.php.net/manual/en/ref.session.php
          >>[/color]
          >
          > I haven't tried it, but can't you serialize() the object, stuff it into
          > a session variable, and then get it back later on?[/color]

          I do this regularly, so I know it can be done. You have to remember to
          include the class definition before you use the unserialize() function.

          --
          Tony Marston

          This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




          Comment

          Working...