Tidied up login.php code, fixed logout button appearing.