public function clearIdentity()
    {
        if ($user = $this->getIdentity()) {
            $auth = $this->authenticationProvider->findByUserId($user->getId());
            $this->resetAuthenticationKey($auth);
        }

        $sp = session_get_cookie_params();
        foreach ([self::COOKIE_USER, self::COOKIE_VERIFY_A, self::COOKIE_VERIFY_B] as $cookieName) {
            setcookie($cookieName, null, null, '/', $sp['domain'], false, true);
        }

        $this->identity = null;
    }