addCookie static method

Future addCookie(
  1. String hostname,
  2. String name,
  3. String value
)

Add a cookie with its name and value to the hostname associated CookieJar.

Implementation

static Future addCookie(String hostname, String name, String value) async {
  var cookieJar = await getStoredCookies(hostname);
  cookieJar[name] = Cookie(name, value);
  await setStoredCookies(hostname, cookieJar);
}