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?
PHP Sessions I am doing something fundamentally wrong
Moderator: General Moderators
Re: PHP Sessions I am doing something fundamentally wrong
Do you see the same session cookie in your browser for both pages? (e.g. in firebug run `document.cookie` on the console)
Re: PHP Sessions I am doing something fundamentally wrong
Can you post the code in question? I mean the code from the page with the <form> as well as the code from the next page where the session is called and the values assigned.