Once the script has authenticated with the database its gets redirected using
header("Location: https://website.com/main.php?".session_name()."=".session_id());
The code in the main.php file is as follows:
session_start();
include_once('header.inc.php');
$mainquery = "SELECT * FROM advertisers WHERE email = '".$_SESSION['login']."' ";
$mainresults = mysql_query($mainquery) or die(mysql_error());
$mainrow = mysql_fetch_array($mainresults);
header.inc.php is as follows:
session_register("login");
session_register("password");
session_register("ad_loggedIn");
checkLoggedIn("yes");