<?PHP 
session_start();
require_once "config.php";
if(!isset($_SESSION['username'])){
	header("location: index.php");
}






/* if(isset($_SESSION["stafflog"]) ){
    header("location: index.php");
    exit;
}
else if(!isset($_SESSION["tenantLog"]) ){
  header("location: index.php");
  exit;
}
ELSE if($_SESSION["username"] == ""){
	header("location: index.php");
	exit;
} */

//Set the session timeout for 20 minutes
//$timeout = 12000;

//Set the maxlifetime of the session
//ini_set( "session.gc_maxlifetime", $timeout );

//Set the cookie lifetime of the session
//ini_set( "session.cookie_lifetime", $timeout );

//Start a new session
//session_start();

//Set the default session name
//$s_name = session_name();

//Check the session exists or not
//if(isset( $_COOKIE[ $s_name ] )) {
   // setcookie( $s_name, $_COOKIE[ $s_name ], time() + $timeout, '/' );
	//session_start();
   // echo "Session is created for $s_name.<br/>";
//} else {
   // echo "Session is expired.<br/>";
	// $error_message = "Session is expired.<br/>";
	//header("Location: index.php?errormsg=$error_message");
//}

//$sessionTYpe = $_SESSION["type"];
// Check if the tenant/staff is already logged in, if yes then redirect him to welcome page
/* if(isset($_SESSION["staffLog"]) && $_SESSION["staffLog"] !== true){
  header("location: index.php");
  exit;
}
else if(isset($_SESSION["tenantLog"]) && $_SESSION["tenantLog"] !== true){
  header("location: index.php");
  exit;
}
ELSE if($_SESSION["username"] == ""){
	header("location: index.php");
	exit;
}
else {
	//echo " else ON";
} */


?>