Posted by Shelly on 05/22/05 15:33
I set a session variable on error in the login page and then call the login
page again. I test on that session variable but it shows as not set. I
checked with an echo immediately after setting the error session variable so
I am 100% positive that it is set. The recursive entry to the login page
echos a message that the error session variable is unset.
Any clues?
Here is the setting code and the testing code (commented out)"
$MM_redirectLoginFailed = "ssLogin.php";
if ($loginFoundUser) {
......
......
} else {
$_SESSION['MM_LoginError'] = "Login Error";
// echo "session variable is " . $_SESSION['MM_LoginError'];
header("Location: ". $MM_redirectLoginFailed );
}
Here is the test to see try to get an error message echoed:
<?php
if (isset($_SESSION['MM_LoginError'])) {
echo "Login error =" . $_SESSION['MM_LoginError'];
unset($_SESSION['MM_LoginError']);
} else {
echo "_SESSION['MM_LoginError'] not set";
}
?>
Navigation:
[Reply to this message]
|