Fix invalid sessions causing a half-logged in state