how to post a login to a web form and keep the session -iphone sdk
-
16-09-2019 - |
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.
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