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
I think problem is header:
('location:------.php);
Your hosting server doesn't run this. You can use this:
echo "";