code: protected String encodeCookie(SerializableHttpCookie cookie) {
          if (cookie == null)
              return null;
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          try {
              ObjectOutputStream outputStream = new ObjectOutputStream(os);
              outputStream.writeObject(cookie);
          } catch (IOException e) {
              Util.log("IOException in encodeCookie", e);
              return null;
          }
  
          return byteArrayToHexString(os.toByteArray());
      }
docs: Serializes Cookie object into String
  
  @param cookie cookie to be encoded, can be null
  @return cookie encoded as String