title: Adding a cookie to web service port client
body: <p>I'm using a web service in my app that requires a specific cookie to be set in order access it's methods.</p>
  
  <p>I was using a generated wrapper class for that service that was created using <code>wsdl.exe</code> tool. Everything is working ok using that method.</p>
  
  <pre><code>// this is the instance of object generated with wsdl.exe
  WSWrapper service = new WSWrapper(); 
  
  // set cookie
  service.CookieContainer = new CookieContainer();    
  Cookie cookie = new Cookie(name, value, path, domain);
  service.CookieContainer.Add(cookie);
  
  // run method requiring cookie to be set
  service.Test(); 
  </code></pre>
  
  <p>Now I wanted to do something similar using Service Reference instead of pre-generated class. I added web reference but there seems to be no <code>CookieContainer</code> (or anything similar) in service reference port client that was generated.</p>
  
  <p>Does anyone knows how to add a cookie to that client?</p>