Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top