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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.