Fix flaw in logout method if cookie is lost