PHP Sessions I am doing something fundamentally wrong
Posted: Thu Apr 05, 2012 2:17 pm
I have been beating my head against the wall with sessions.
I do have the <?PHP session_start(); ?> as the first line of my file, no white space, nothing before it.
Then, I set the Session array like:
<?PHP
session_start();
$_SESSION['email'] = $_POST['email'];
$_SESSION['password'] = $_POST['password'];
?>
Then In another page, I have the <?PHP session_start(); ?> again as the first line, then I have this code to simply print out the variables:
<?PHP
session_start();
echo "Email= ". $_SESSION['email'];
echo "Password= ". $_SESSION['password'];
?>
And I get nothing. Any ideas what I should look for?
I do have the <?PHP session_start(); ?> as the first line of my file, no white space, nothing before it.
Then, I set the Session array like:
<?PHP
session_start();
$_SESSION['email'] = $_POST['email'];
$_SESSION['password'] = $_POST['password'];
?>
Then In another page, I have the <?PHP session_start(); ?> again as the first line, then I have this code to simply print out the variables:
<?PHP
session_start();
echo "Email= ". $_SESSION['email'];
echo "Password= ". $_SESSION['password'];
?>
And I get nothing. Any ideas what I should look for?