If `$this->user` is set, then you will never end up in this codepath, so only checking the second conditional should be enough, or you end up clearing even when there is nothing to clear.