protected function tokenCookie(UriInterface $uri, string $token): Cookie
    {
        return Cookie::create(
            $this->config->csrfCookie(),
            $token,
            $this->config->csrfLifetime(),
            $this->config->basePath(),
            $this->config->cookieDomain($uri),
            $this->config->csrfSecure(),
            true
        );
    }