You should use the POST value you are storing as a trigger for saving the SESSION variables... so on the login page line 6 you should have:
if(isset($_POST["numberoftickets"])) {
$_SESSION["tics"] = "".((isset($_POST["numberoftickets"]))?$_POST["numberoftickets"]:"") ."";
}
"before page load" happens twice. Once when the page loads, and once more when you submit the login form. The second time is when it gets cleared.