Why are you making things more complicated than needed ?
$_SESSION is all you need.
When you check the persons login and password to your database and it matches, simply flag a session variable as having the person logged in.
$_SESSION['user_logged_in']="ooooYESBabyImIn";
then have a check built into the top of every page that is only availalbe to people who have logged in, obviously you only do this with an include.
Code:
if ($_SESSION['user_logged_in']=="ooooYESBabyImIn"){
Let the person view stuff
}else{
Tell them they have to log in and give them a log in form
}
__________________