code: private static String convertV1Cookie(HttpCookie cookie) {
          StringBuilder buffer = new StringBuilder(40);
  
          // Append name=value
          buffer.append(cookie.getName());
          buffer.append('=');
          maybeQuote(buffer, cookie.getValue());
  
          // Always append the version
          buffer.append("; $Version=1");
  
          // check for optional path
          String value = cookie.getPath();
          if (null != value && 0 != value.length()) {
              buffer.append("; $Path=");
              if (!skipCookiePathQuotes) {
                  maybeQuote(buffer, value);
              } else {
                  buffer.append(value);
              }
          }
  
          // check for optional domain
          value = cookie.getDomain();
          if (null != value && 0 != value.length()) {
              buffer.append("; $Domain=");
              maybeQuote(buffer, value);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Created v1 Cookie: [" + buffer.toString() + "]");
          }
          return buffer.toString();
      }
docs: Convert the V1 Cookie into a Cookie header string.
  
  @param cookie
  @return the value of the header.