private void ReSetCookie(HttpWebResponse response) { if (response.Cookies != null) { foreach (Cookie item in response.Cookies) { if (Cookies.All(p => p.Name != item.Name)) { Cookies.Add(item); } else { for (int i = 0; i < Cookies.Count; i++) { if (item.Name == Cookies[i].Name) { Cookies[i] = item; } } } } } }