HttpWebResponse.Cookies empty despite Set-Cookie Header (no-redirect)

前端 未结 7 1602
刺人心
刺人心 2020-12-28 14:00

I\'m struggling to figure out what is wrong here. I\'m sending login information, I can see the Set-Cookie in the Header with the correct value, but the Cookies collection

7条回答
  •  攒了一身酷
    2020-12-28 14:13

    That could be a bit late, but you can use function SetCookies

    var cHeader = responce.Headers.Get("Set-Cookie");
    var cookie = new CookieContainer();
    cookie.SetCookies(new Uri("[...]"), cHeader);
    

提交回复
热议问题