0

I've created a CookieContainer and stored the cookies from a HttpWebRequest in it. Is there a way I can use this CookieContainer on a WebBrowser control?

Thanks for the help.

Joey Morani
  • 25,431
  • 32
  • 84
  • 131
  • Looks like a duplicate of http://stackoverflow.com/questions/4185171/use-cookies-from-cookiecontainer-in-webbrowser and http://stackoverflow.com/questions/1688991/how-to-set-and-delete-cookies-from-webbrowser-control-for-arbitrary-domains – Martin Ernst May 21 '12 at 17:11
  • First one didn't work. But didn't find the second one before. I'll have a look at that now. :) – Joey Morani May 21 '12 at 17:25

1 Answers1

1

You can get the cookie value from the container with GetCookieHeader method.

Lakis
  • 301
  • 2
  • 6
  • Thanks. Got the cookie in a string now. Any idea how to set the cookie on the WebBrowser? – Joey Morani May 21 '12 at 17:39
  • 1
    I have no experience with webbrowser since I prefer using HTTPWebRequst. Anyways, you can try setting the cookie : webborwser.document.cookie – Lakis May 21 '12 at 18:18