title: Set NSHTTPCookieExpires manually
body: <p>I want to set a <code>NSHTTPCookie</code> in the <code>NSHTTPCookieStorage</code>.</p>
  
  <p>For doing that, I am creating a cookie &amp; adding it to the <code>NSHTTPCookieStorage</code> as shown below:-</p>
  
  <pre><code>NSDictionary  *propertiesDevice = [NSDictionary dictionaryWithObjectsAndKeys:
                                     @"http://www.sample.com/", NSHTTPCookieDomain,
                                     @"/", NSHTTPCookiePath,
                                     @"someCookieName", NSHTTPCookieName,
                                     @"myCookieValue", NSHTTPCookieValue,
                                     timeStamp,NSHTTPCookieExpires,nil];
  NSHTTPCookie *cookieDevice = [NSHTTPCookie cookieWithProperties:propertiesDevice];
  [[NSHTTPCookieStorage sharedHTTPCookieStorage]setCookie:cookieDevice];
  </code></pre>
  
  <p>All the properties of the <code>NSHTTPCookie</code> sets as expected, apart from the <code>NSHTTPCookieExpires</code>.</p>
  
  <ol>
  <li>If I pass <code>[NSDate date]</code>, then the value is set. But the problem is it is not in the desired <code>NSHTTPCookie</code> format of <code>Expires=Tue, 15-Jan-2013 21:47:38 GMT</code>. The format of <code>[NSDate date]</code> is <code>2014-06-19 12:04:00 +0000</code>.</li>
  <li>When I try to change the format of <code>NSDate</code> using <code>NSDateFormatter</code>, the output is <code>NSString</code>.</li>
  <li>The problem is that no matter what <code>NSString</code> I set to <code>NSHTTPCookieExpires</code> key, it takes <code>null</code> value.</li>
  </ol>
  
  <p>Though in the documentation it says that <code>NSHTTPCookieExpires</code> takes <code>NSString</code> or <code>NSDate</code>.</p>
  
  <pre><code>    From Apple Doc:-
  
      &lt;td&gt;NSHTTPCookieExpires&lt;/td&gt;
      &lt;td&gt;NSDate or NSString&lt;/td&gt;
      &lt;td&gt;NO&lt;/td&gt;
      &lt;td&gt;Expiration date for the cookie. Used only for version 0
      cookies. Ignored for version 1 or greater.&lt;/td&gt;
  </code></pre>
  
  <p>Does anyone have any idea as to why we are not able to set <code>NSString</code> value for the key <code>NSHTTPCookieExpires</code>?</p>