Hi all,

Maybe this is a stupid question, but I'm using $SESSION in order to set some user session preferences. One of that is $SESSION['user'].

When I set $user variable also $_SESSION['user'] is set with same value? I have some problems with that I need to know if the problem is for that.

Thanks!

    No, they are two separate variables. If you want both set to the same value, you will need to set each. You can, however, do it in one statement:

    $_SESSION['user'] = $user = get_user_name();
    

      Hi,

      Thanks for your reply!!

      Maybe it's the server configuration, but, after many tries, I can confirm when I set $user also is set $_SESSION['user'], I'm confused... :quiet:

        Perhaps your server has the deprecated register_globals setting enabled? In that case, when the script initiates scalar variables will be generated for the various super-global array elements ($SESSION, $COOKIE, $POST, and $GET).

          NogDog;10908669 wrote:

          Perhaps your server has the deprecated register_globals setting enabled? In that case, when the script initiates scalar variables will be generated for the various super-global array elements ($SESSION, $COOKIE, $POST, and $GET).

          I've checked it and register_globals is enabled. Still there are servers using PHP4 with deprecated and unsafe configurations. I'll take care of this.

          Thanks!!

            Write a Reply...