register_global = on, mix between $_SESSION and local variables

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

    #1

    register_global = on, mix between $_SESSION and local variables

    Hi,
    I'm coding Php under register_global = off flag, but, most (all ?) of php
    hosting companies use the "on" flag with their shared servers...
    I spent too much time to finally discover that my sessions went mad because
    the $_SESSION['pseudo'] was updated by a simple $pseudo = $row['pseudo']
    (from the DB)...
    It's ok when, on my local conf, i use it with the register_global = off, but
    once uploaded online, on a shared server with register_global = on, sessions
    goes mad... I use the built-in php session mechanism and the file where
    information session is saved is updated in a wrong way because of this
    mix...

    Is there another way for me than avoid using same names with my $_SESSION
    stuff and other local variables ?

    Thanks a lot,
    Arnaud


  • Aphrael

    #2
    Re: register_global = on, mix between $_SESSION and local variables

    Undercat wrote:[color=blue]
    > Hi,
    > I'm coding Php under register_global = off flag, but, most (all ?) of php
    > hosting companies use the "on" flag with their shared servers...
    > I spent too much time to finally discover that my sessions went mad because
    > the $_SESSION['pseudo'] was updated by a simple $pseudo = $row['pseudo']
    > (from the DB)...
    > It's ok when, on my local conf, i use it with the register_global = off, but
    > once uploaded online, on a shared server with register_global = on, sessions
    > goes mad... I use the built-in php session mechanism and the file where
    > information session is saved is updated in a wrong way because of this
    > mix...
    >
    > Is there another way for me than avoid using same names with my $_SESSION
    > stuff and other local variables ?
    >
    > Thanks a lot,
    > Arnaud
    >
    >[/color]
    You know you can use a .htaccess on your hosting platform to have Global
    off just in the folder you want ? Some self-made security...

    Something like...

    <IfModule mod_php4.c>
    php_flag register_global s off
    </IfModule>

    Aphrael
    --
    "La demande mondiale d’ordinateurs n’excédera pas cinq machines."
    (Thomas Watson, Fondateur d'IBM, 1945)

    Comment

    • Sharif T. Karim

      #3
      Re: register_global = on, mix between $_SESSION and local variables

      Aphrael, being the foo Aphrael is, wrote:[color=blue]
      > Undercat wrote:[color=green]
      >> Hi,
      >> I'm coding Php under register_global = off flag, but, most (all ?)
      >> of php hosting companies use the "on" flag with their shared
      >> servers...
      >> I spent too much time to finally discover that my sessions went mad
      >> because the $_SESSION['pseudo'] was updated by a simple $pseudo =
      >> $row['pseudo'] (from the DB)...
      >> It's ok when, on my local conf, i use it with the register_global =
      >> off, but once uploaded online, on a shared server with
      >> register_global = on, sessions goes mad... I use the built-in php
      >> session mechanism and the file where information session is saved is
      >> updated in a wrong way because of this mix...
      >>
      >> Is there another way for me than avoid using same names with my
      >> $_SESSION stuff and other local variables ?
      >>
      >> Thanks a lot,
      >> Arnaud
      >>
      >>[/color]
      > You know you can use a .htaccess on your hosting platform to have
      > Global off just in the folder you want ? Some self-made security...
      >
      > Something like...
      >
      > <IfModule mod_php4.c>
      > php_flag register_global s off
      > </IfModule>
      >
      > Aphrael[/color]

      Would that work for the entire website? Say I wanted to have
      register_global s off as well but my host doesn't have it.

      --
      Sharif T. Karim
      ....you don't know wrath yet...


      Comment

      • Phil Roberts

        #4
        Re: register_global = on, mix between $_SESSION and local variables

        "Sharif T. Karim" <sharif@nyc.rr. com> emerged reluctantly from the
        curtain and staggered drunkenly up to the mic. In a cracked and
        slurred voice he muttered:
        [color=blue]
        > Aphrael, being the foo Aphrael is, wrote:[color=green]
        >> Undercat wrote:[color=darkred]
        >>> Hi,
        >>> I'm coding Php under register_global = off flag, but, most
        >>> (all ?) of php hosting companies use the "on" flag with their
        >>> shared servers...
        >>> I spent too much time to finally discover that my sessions
        >>> went mad because the $_SESSION['pseudo'] was updated by a
        >>> simple $pseudo = $row['pseudo'] (from the DB)...
        >>> It's ok when, on my local conf, i use it with the
        >>> register_global = off, but once uploaded online, on a shared
        >>> server with register_global = on, sessions goes mad... I use
        >>> the built-in php session mechanism and the file where
        >>> information session is saved is updated in a wrong way because
        >>> of this mix...
        >>>
        >>> Is there another way for me than avoid using same names with
        >>> my $_SESSION stuff and other local variables ?
        >>>
        >>> Thanks a lot,
        >>> Arnaud
        >>>
        >>>[/color]
        >> You know you can use a .htaccess on your hosting platform to
        >> have Global off just in the folder you want ? Some self-made
        >> security...
        >>
        >> Something like...
        >>
        >> <IfModule mod_php4.c>
        >> php_flag register_global s off
        >> </IfModule>
        >>
        >> Aphrael[/color]
        >
        > Would that work for the entire website? Say I wanted to have
        > register_global s off as well but my host doesn't have it.
        >[/color]

        ..htaccess rules cascade to all sub-directories.

        --
        Phil Roberts | Without me its just aweso. | http://www.flatnet.net/

        "Mankind differs from the animals only by a little,
        and most people throw that away."
        - Confucious

        Comment

        • Undercat

          #5
          Re: register_global = on, mix between $_SESSION and local variables

          "Aphrael" <Aphrael@_ANTIS PAMisuisse_com> a écrit dans le message de
          news:40eec883$1 _2@news.bluewin .ch...[color=blue]
          > You know you can use a .htaccess on your hosting platform to have Global
          > off just in the folder you want ? Some self-made security...
          > Something like...
          > <IfModule mod_php4.c>
          > php_flag register_global s off
          > </IfModule>[/color]

          Hi,
          Yes, good idea, i'll try !

          Thanks,
          arnaud.


          Comment

          Working...