JSONObject cookie = cookies.optJSONObject(i);
String name = cookie.optString("name");
String value = cookie.optString("value");
String domain = cookie.optString("domain");
String path = cookie.optString("path");
Date expiry = new Date(cookie.optLong("expires"));
boolean isSecure = cookie.optBoolean("secure");
Cookie c = new Cookie(name, value, domain, path, expiry, isSecure);
res.add(c);
}
return res;