Right i am trying to impliment a login page that will use sessions for security on further pages.
if the data supplied passes the checks then this code is run:
session_start();
session_name("myLogin"
$UserID = $UserRow["UserID"];
$UserName = $UserRow["username"];
$AccessID = $UserRow["accessID"];
$LoggedIn = 1;
//set the session variables
$_SESSION["USerID"] = $UserID;
$_SESSION["UserName"] = $UserName;
$_SESSION["AccessID"] = $AccessID;
$_SESSION["LoggedIn"] = $LoggedIn;
I can see the sessions being created in my session directory. when i move onto other pages i have put some code that checks for the existance of the session:
if (! IsSet($_SESSION['UserID'])) {
header("Location: $refer_url"
} else {
echo "The value of the SID variable is: " .SID;
}
this is always doing refering me back to my login page. I have seen that there is a variable called SID that i can include on all of the pages to pass the session info but when i try to use this i get nothing back, its empty.
I haven't changed any of the settings in the php.ini file, and i am running php 4.2.1 on window nt server running iis 4.
any ideas why this variable is empty all the time?
if the data supplied passes the checks then this code is run:
session_start();
session_name("myLogin"
$UserID = $UserRow["UserID"];
$UserName = $UserRow["username"];
$AccessID = $UserRow["accessID"];
$LoggedIn = 1;
//set the session variables
$_SESSION["USerID"] = $UserID;
$_SESSION["UserName"] = $UserName;
$_SESSION["AccessID"] = $AccessID;
$_SESSION["LoggedIn"] = $LoggedIn;
I can see the sessions being created in my session directory. when i move onto other pages i have put some code that checks for the existance of the session:
if (! IsSet($_SESSION['UserID'])) {
header("Location: $refer_url"
} else {
echo "The value of the SID variable is: " .SID;
}
this is always doing refering me back to my login page. I have seen that there is a variable called SID that i can include on all of the pages to pass the session info but when i try to use this i get nothing back, its empty.
I haven't changed any of the settings in the php.ini file, and i am running php 4.2.1 on window nt server running iis 4.
any ideas why this variable is empty all the time?