I'm having a really weird issue saving form values submitted through $_POST as session variables.
OK, so I have a form on page 1 which submits to page 2.
On page 2 I am setting all of the Post variables to Session variables.
On page 3 I am retrieving those variables.
On page 2 if I write something like this:
$_SESSION['fname'] = 'john';
It works fine. I can retrieve it on page 3.
If I write something like
$_SESSION['fname'] = $_POST['fname'];
That session variable is blank on page 3.
Even weirder, if I do something like:
$_SESSION['fname'] = $_POST['fname'].' Doe';
On page 3 I see just Doe.
Session variables that were previously set by other pages are also fine on page 3.
I have verified that the post variables are set on page 2, and I'm at a loss at this point. I'm not a PHP session expert or anything, but I have worked with them before and haven't seen anything like this.
Anyone have any thoughts?
Edit: The variable is being set in the session, it's just blank on page 3.