private function sessionCookie(UriInterface $uri, string $id = null): Cookie
    {
        return Cookie::create(
            $this->config->getCookie(),
            $id,
            $this->config->getLifetime(),
            $this->httpConfig->basePath(),
            $this->httpConfig->cookieDomain($uri),
            $this->config->isSecure(),
            true
        );
    }