CookieHeaderValue ch;
List<CookieHeaderValue> cookieList = new List<CookieHeaderValue>();
if (cookieStore != null)
{
if (resp.Headers.Get("ETag") != null)
{
foreach (Cookie ck in cookieStore.GetCookies(GetRequest.RequestUri))
{
ch = new CookieHeaderValue(ck.Name, ck.Value);
ch.Path = "/";
cookieList.Add(ch);
}
ch = new CookieHeaderValue("ETag", resp.Headers.Get("ETag"));
ch.Path = "/";
cookieList.Add(ch);
}
result = sourceRequest.CreateResponse(resp.StatusCode);
result.Content = new StringContent(resultData, Encoding.UTF8, responseFormat);
result.Headers.AddCookies(cookieList);
I tried the same in google.most of them mentioned like it might be domain issue.I am not calling from the mylocal.I want to store cookies in the browser.