Jump to content

Is $_SESSION["whatever"] EQUAL TO $whatever? Mine is. Is this normal?


beer

Recommended Posts

I have a question:

 

If you do this:

 

$first_name = "bart";

$_SESSION["first_name"] = $first_name;

echo $_SESSION["first_name"];

 

 

You'll get bart, CORRECT?

 

Now try this:

 

$_SESSION["last_name"] = "simpson";

echo $last_name;

 

 

What do you get? Yes, that's right: simpson

 

Is this the normal behavior of SESSION? That is, just put a $ plus whatever's inside $_SESSION[""], and you get a variable that is EQUIVALENT to your SESSION?

 

Try it for yourself! Please help me clarify this.... Thanks.

Hi Muffins, thanks for the help.

 

Nope, I don't have a variable SET Globally, in fact, I have put something $_SESSION["this_is_weird"] and echo $this_is_weird... then I still get the same value of the session!

 

 

@thorpe - That is it! Thank you so much! I turned it OFF and it's gone. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.