You are here: Problem with recursive page and session variable « PHP Programming Language « IT news, forums, messages
Problem with recursive page and session variable

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация