title: WPF WebBrowser Cookies to be used in WebRequest
body: <p>I try to construct WebRequest to a web page after successful logging in to secured web portal via WPF WebBrowser control, but stuck with the problem of reusing WebBrowser cookies in WebRequest. </p>
  
  <p>Unlike WinForms, in WPF WebBrowser control there is no way to extract CookieCollection via WebBrowser.Document.Cookies because Document object does not have Cookies property. The
  only way I found is to use mshtml.HTMLDocument2 which has cookies as string</p>
  
  <pre><code>        mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)webBrowser.Document;
          string cookies = doc.cookie;
  </code></pre>
  
  <p>However it is not good enough as looks like MSHTML.Document2 
  - does not allow to extract important HttpOnly cookies (like ASP.Net_SessionID)
  - and I need manually construct CookiesCollection object from Cookies string.</p>
  
  <p>As a result, WebRequest with cookies constructed from string is failing with Session timeout error as ASP.Net_SessionID is not available.</p>
  
  <p>Is there another way of building proper and completed CookieCollection object from WPF WebBrowser control?</p>