setCookie method
void
setCookie()
override
Implementation
@override
void setCookie(String url, String keyValue, String expires, JSPromise promise) {
var cookies = <Cookie>[];
var keyValueList = keyValue.split(';');
for (var item in keyValueList) {
var cookieInfo = item.split('=');
var cookieItem = Cookie(cookieInfo[0], cookieInfo[1]);
if (!isEmpty(expires)) {
cookieItem.expires = DateTime.parse(expires);
}
cookies.add(cookieItem);
}
channel.CookieManager.getInstance().setCookie(url, cookies);
promise.resolve(0);
}