between session-register and $_SESSION

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

    between session-register and $_SESSION

    Hi,
    I read in the help http://www.php.net/session_register that using
    $_SESSION[var]=value is better than using session_registe r... is it true in
    all cases?

    thanks


  • Chung Leong

    #2
    Re: between session-register and $_SESSION

    Depends on the purpose of these session variables and how they're used. In
    most cases accessing them $_SESSION[] is preferrable, because it's easier to
    understand.

    Uzytkownik "toufik toufik" <toufiki@sympat ico.ca> napisal w wiadomosci
    news:aNPSb.7156 $qU3.690608@new s20.bellglobal. com...[color=blue]
    > Hi,
    > I read in the help http://www.php.net/session_register that using
    > $_SESSION[var]=value is better than using session_registe r... is it true[/color]
    in[color=blue]
    > all cases?
    >
    > thanks
    >
    >[/color]


    Comment

    • Tony Marston

      #3
      Re: between session-register and $_SESSION


      "toufik toufik" <toufiki@sympat ico.ca> wrote in message
      news:aNPSb.7156 $qU3.690608@new s20.bellglobal. com...[color=blue]
      > Hi,
      > I read in the help http://www.php.net/session_register that using
      > $_SESSION[var]=value is better than using session_registe r... is it true[/color]
      in[color=blue]
      > all cases?
      >
      > thanks[/color]

      session_registe r() only works if register_global s is set ON in your php.ini
      file, but for security purposes this has been disabled by default since PHP
      4.2.0 You should therefore use $_SESSION['var'] instead.

      Tony Marston


      Comment

      Working...