How it should work: Index.php is the secured page. It includes check.php, which checks if you have a session = good. If it hasn\'t, you\'re not logged in -> log off, remove sess
You need to have session_start() at the top of all the pages, you havent shown the session start for your login page.
(Thanks to Danny for proving I cant type)