code: private void syncHttpClientCookies() {
          webDriver.manage()
                  .getCookies()
                  .stream()
                  .map(CookieConverter::convertToHttpClientCookie)
                  .forEach(cookieStore::addCookie);
      }
docs: Copies all the Selenium cookies for the current domain to the HTTP client cookie store.