Strange occurence with Session Variables.
Posted: Thu Oct 13, 2011 8:03 am
First off, the below has been working without issue for 4 years now.
I have a Login page that accepts a username and password. I execute the query and set credentials into Session variable like below, this has always worked.
On my Index.php I check for Credentials, for some reason my IF statement now fails. I checked the Sessions on the Login page and the Exist.
The only thing that I know has changed was that the Php was upgraded recently so that WordPress could be run. Ideas anyone?
I have a Login page that accepts a username and password. I execute the query and set credentials into Session variable like below, this has always worked.
Code: Select all
if($row= mysql_fetch_array($result)){
//Login Successful
$_SESSION['SESS_ENABLED'] = 'Authenticated';
session_write_close();
header("location: index.php");
exit();
}else {
//Login failed
header("location: login-failed.php");
exit();
}Code: Select all
if(!isset($_SESSION['SESS_ENABLED']) || (trim($_SESSION['SESS_ENABLED']) == '')) {
header("location: access-denied.php");
exit();
}