core/play/src/main/java/play/core/cookie/encoding/ClientCookieEncoder.java
public String encode(Cookie cookie) {
    if (cookie == null) {
      throw new NullPointerException("cookie");
    }
    StringBuilder buf = new StringBuilder();
    encode(buf, cookie);
    return stripTrailingSeparator(buf);
  }
public String encode(Cookie cookie) {
    if (cookie == null) {
      throw new NullPointerException("cookie");
    }
    StringBuilder buf = new StringBuilder();
    encode(buf, cookie);
    return stripTrailingSeparator(buf);
  }
Encodes the specified cookie into a Cookie header value.

@param cookie specified the cookie
@return a Rfc6265 style Cookie header value