Check for logout before doing anything in index.php.