title: C# Extract Cookie Values from Webbrowser Control?
body: <p>Well This questions as far I was searching never been asked before... </p>
  
  <p>I'm trying to extract a cookie value from my webbrowser control I wasn't been able to find any helpful information I want to extract the cookies values after webbrowser navigate:</p>
  
  <pre><code> private void Form1_Load(object sender, EventArgs e)
          {
              webBrowser1.Navigate("http://site.com");
          }
  </code></pre>
  
  <p>I have a nice code for regex find for httpwebreqest something similar to webbrowser control is what I'm trying to do:</p>
  
  <pre><code>   List&lt;string&gt; cookieValues = new List&lt;string&gt;();
              foreach (Cookie cookie in agent.LastResponse.Cookies)
              {
                  cookieValues.Add(cookie.Value);
              }
    foreach (string i in cookieValues)
              {
                  Match match2 = Regex.Match(i, @"bert=([\w]*)",
                     RegexOptions.IgnoreCase);
  
                  // Ensure match
                  if (match2.Success)
                  {
                      // Finally, we get Group value and display it.
                      key2 = match2.Groups[1].Value;
  
                  }
  </code></pre>
  
  <p>Honestly I didn't play with webbrowser so I got no clue where to start. Got any ideas? From what I been researching it's possible Webbrowser control are the same cookies in IE? </p>