public static String toString(JSONObject o) throws JSONException {
  StringBuilder sb=new StringBuilder();
  sb.append(escape(o.getString("name")));
  sb.append("=");
  sb.append(escape(o.getString("value")));
  if (o.has("expires")) {
    sb.append(";expires=");
    sb.append(o.getString("expires"));
  }
  if (o.has("domain")) {
    sb.append(";domain=");
    sb.append(escape(o.getString("domain")));
  }
  if (o.has("path")) {
    sb.append(";path=");
    sb.append(escape(o.getString("path")));
  }
  if (o.optBoolean("secure")) {
    sb.append(";secure");
  }
  return sb.toString();
}

public static String toString ( JSONObject o ) throws JSONException { StringBuilder sb = new StringBuilder ( ) ; sb . append ( escape ( o . getString ( "name" ) ) ) ; sb . append ( "=" ) ; sb . append ( escape ( o . getString ( "value" ) ) ) ; if ( o . has ( "expires" ) ) { sb . append ( ";expires=" ) ; sb . append ( o . getString ( "expires" ) ) ; } if ( o . has ( "domain" ) ) { sb . append ( ";domain=" ) ; sb . append ( escape ( o . getString ( "domain" ) ) ) ; } if ( o . has ( "path" ) ) { sb . append ( ";path=" ) ; sb . append ( escape ( o . getString ( "path" ) ) ) ; } if ( o . optBoolean ( "secure" ) ) { sb . append ( ";secure" ) ; } return sb . toString ( ) ; }
convert a jsonobject into a cookie specification string . the jsonobject must contain " name " and " value " members . if the jsonobject contains " expires " , " domain " , " path " , or " secure " members , they will be appended to the cookie specification string . all other members are ignored .
