private function addSessionCookie(ResponseInterface $response):ResponseInterface
    {
        $params = session_get_cookie_params();
        $cookie = new SetCookie(
            session_name(),
            session_id(),
            time() + $params["lifetime"],
            $params["path"],
            $params["domain"],
            $params["secure"],
            $params["httponly"]
        );
        return $cookie->addToResponse($response);
    }