CookieCollection cookiesResponse = new CookieCollection(); if (response != null)
{
foreach (string cookie in response.Headers["Set-Cookie"].Split(';'))
{
string name = cookie.Split('=')[];
string value = cookie.Substring(name.Length + );
cookiesResponse.Add(new Cookie(name.Trim(), value.Trim(), path, domain));
}
}