If I remove this the logout page will render but will still show me as still logged in. I have to refresh the page at least once before the $_SESSION['username'] is unset. I guess the view is being displayed before the session_destroy() is executed?