title: iPhone Cookie Management
body: <p>I am writing an app that needs to store a cookie.</p>
  
  <p>my plan is to do the following.</p>
  
  <pre>
  // create a ref to shared storage area
  
  NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
  
  // query the current acceptpolicy (ie want to store it for later...)
  
  [cookieJar cookieAcceptPolicy];       /********   This line crashes app   ********/
  
  [cookieJar setcookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
  
  NSArray *mycookies = [cookieJar cookies];
  
  .....  do more stuff
  ..... change it back....
  </pre>
  
  <p>Problem is I can't figure out how to store the result of cookieAcceptPolicy for later use.  the docs shows - <code>(NSHTTPCookieAcceptPolicy)cookieAcceptPolicy</code>, makes no sense to me.</p>
  
  <p>Help appreciated.</p>