Ok here's a the relevant bits of code. I was trying to avoid this since theres alot of code and it does work on my Windows machine 🙂
This is the constructor of Index.php
function homepage(){
// This line loads an array of system variables
$this->env = $this->loadConfig();
// This line runs a function in the base class (shown below)
$this->uData = $this->getUserPermissions();
// This if/else checks an array (if present then session is ok)
if($this->uData['tx_app_forenm'] != ''){
$this->showUserDetails();
}else{
/* Kill any session */
session_destroy();
// This shows the HTML template
$this->showForm();
}
}
This next bit is at the very end of Login.php. If the user has got to here then login was successful
/* Write some useful data to the session */
$_SESSION['uid'] = $this->user_data['id_app'];
$_SESSION['cd_access'] = $this->user_data['cd_access'];
$_SESSION['id_contract'] = $this->user_data['id_contract'];
$_SESSION['cd_app_status'] = $this->user_data['cd_app_status'];
session_write_close();
$this->getRefererInfo();
if(!isset($this->referer['path'])){
header("Location: ".$this->env['systemurl']."/".$this->env['index']);
}else{
header("Location: ".$this->referer['path']);
}
exit();
This is the method in the base class which all inheriting classes need to call to get the session data
function getUserPermissions(){
session_start();
$this->sql = new SqlQueryHandler();
/* Get a record from the db. based on session ID */
$this->uData = $this->sql->getMySqlSet("SELECT
t1.id_app, t1.cd_access, t1.tx_log_email, t1.tx_app_forenm, t1.tx_app_surnm, max(t2.ts_logon)
FROM applicant as t1, app_logon as t2
WHERE t1.id_app = '".$_SESSION['uid']."'
AND t2.id_app = t1.id_app
GROUP BY id_app
");
return $this->uData;
}
I might have made some typos getting this into the forum.
By the way there is nothing relevant in Register.php apart from the fact that it lays up the same HTML page as Login and Index. Remember when taking the path Register > Login > Index everything works fine both on Win/*nix 😕
In answer to your questions, no the pages are not in frames, and the session is destroyed if not complete.