title: Webclient headers cookie string formatting
body: <p>I am currently using a WebClient in WPF to download a file. I have cookies stored in a WebBrowser and I need to get them to the WebClient object in order to download the file. I am able to get the Browser cookies into a cookie container and then enumerate them to view their values. During enumeration I want to add the cookies into my WebClient. Example:</p>
  
  <pre><code> foreach(Cookie cookie is responseCookies)
   {
       client.headers.Add(HttpRequestHeader.Cookie, "My cookie string");
   }
  </code></pre>
  
  <p>The issue I am having is the a Cookie object won't display a full cookie string, but only the value portion of a cookie (i.e. cookie.ToString()). I can however view the expiration, name, path if I look at each value separately.</p>
  
  <pre><code>cookie.Name.ToString()
  cookie.Path.ToString()
  </code></pre>
  
  <p>So my question is, how can I combine those pieces of information together into one string in order to get a legitimate cookie with the following values for use in my client object: NAME, VALUE, DOMAIN, PATH, EXPIRATION.</p>
  
  <p>All I have found regarding this is to use "cookiename=cookievalue" but that obviously doesn't work in my case.</p>