title: How do I convert an NSHttpCookie to a System.Net.Cookie in MonoTouch?
body: <p>I have a MonoTouch iPhone app that does federated sign in via the Azure Access Control Service. The login is done via an embedded UIWebView browser. When the login is done, I want to transfer the cookie into my app. I have access to the</p>
  
  <pre><code>NSHttpCookieStorage.SharedStorage.Cookies
  </code></pre>
  
  <p>collection, so I can find the cookie. But in order to call the back end services, I need to have a</p>
  
  <pre><code>System.Net.Cookie
  </code></pre>
  
  <p>that I can put into a CookieContainer to send to the service.</p>
  
  <p>How do I convert between the two... is this the only way?</p>
  
  <pre><code>NSHttpCookie cookie = NSHttpCookieStorage.SharedStorage.Cookies[0];
  System.Net.Cookie newCookie = new System.Net.Cookie()
      {
          Name = cookie.Name,
          Value = cookie.Value,
          Version = (int) cookie.Version,
          Expires = cookie.ExpiresDate,
          Domain = cookie.Domain,
          Path = cookie.Path,
          Port = cookie.PortList[0].ToString(), // is this correct??
          Secure = cookie.IsSecure,
          HttpOnly = cookie.IsHttpOnly
      };
  </code></pre>