title: Copying Selenium Cookies to CookieContainer
body: <p>I tried:</p>
  
  <pre><code>foreach (OpenQA.Selenium.Cookie cook in driver.Manage().Cookies.AllCookies)
  {
      System.Net.Cookie cookie = new System.Net.Cookie();
      cookie.Name = cook.Name;
      cookie.Value = cook.Value;
      cookie.Domain = cook.Domain;
      header.Add(cookie);
  }
  </code></pre>
  
  <p>But it gave me a <code>NullReference</code> at <code>header.Add(cookie);</code></p>
  
  <p>I'm trying to get the cookies of my Selenium driver to a <code>CookieContainer</code> to use in a <code>WebRequest</code>.</p>