views:

427

answers:

1

iphone sdk question: I need to login to a web app and keep the session (session cookie) and then get an xml feed.

I haven't found a good example for this.

+1  A: 

I think all you need to do is call:

[[NSHTTPCookieStorage sharedHTTPCookieStorage]
 setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];

and, assuming you're using NSURLConnection, it will save any cookies the server sets for you, and regular cookie-based authentication will just work.

Tyler
cool. i'll give this a try.
phil swenson