I have a page whose SQL creates a user key then creates a SESSION variable and passes variable to the login_success.php file where I want to echo the value of the SESSION variable. However, I have not been able to successfully echo that value on the login_success page. Instead the page merely displays “Login was successful. The user key is .”
The code on my first page, beginning at the echo statement below which does echo the correct value of $userkey is:
// Register $userkey and redirect to login_success.php
$_SESSION['userkey'] = ".$userkey.";
The code on my login_success.php file is:
// Check if session is not registered , redirect back to main page.
echo "Login was successful. The user key is ".$_SESSION['userkey'];
Can someone tell me where I am making the error(s)?