1

I'm trying to let my server set a cookie, however, for some reason my WebRequest does not contain a definition for CookieContainer. Can't find anybody on the internet with the same problem:

WebRequest request = WebRequest.Create(url);
request.CookieContainer = new CookieContainer();

I'm using Visual Studio 2015. I tried to add a reference to System.Net.Http.WebRequest, but no luck. Does anybody understand what the problem is? Any help is highly appreciated!

Saskia
  • 474
  • 5
  • 13
  • Thanks, I guess that solved the question. I did see that one, however it was unclear to me what asker meant, like he could use the above just fine and only wanted to replace the code. I changed my stuff to HttpWebResponse and things are working fine now, thanks! – Saskia Aug 28 '18 at 23:16

0 Answers0