/// <summary> /// Add a Cookies to the page. /// If the domains do not match, the Cookie will be ignored/rejected. /// Returns true if successfully added, otherwise false. /// </summary> /// <param name="data"></param> /// <returns></returns> public bool addCookie(Dictionary<string, object> data) { Cookie cookie = new Cookie(); try { cookie.Load(data); if (cookie.Domain == uri.Host) { return CookieJar.Current.Add(cookie); } } catch { } return false; }
public bool Add(Dictionary<string, object> data, string url) { if (data != null) { Cookie cookie = new Cookie(); cookie.Load(data); return Add(cookie, url); } return false; }