I am using the AFNetworking Framework for iOS. I subclassed AFHttpClient and used it as a singleton, i.e. [TestAFClient sharedClient]
I am using the ASP.NET web service API, which requires the use of cookie.ASPXAUTH. First I have to authenticate, get a cookie.ASPXAUTH in response, and then pass this cookie with each subsequent request.
After several tests, it seems that since I use singleton AFHTTPClient, cookie.ASPXAuth is saved and therefore no explicit cookie storage is required.
However, as part of my application, I need to “log out” at some point.
What is the most efficient way to clear this cookie in order to log out? Set singleton to nil and reinitialize it? Do something like setValue:forKey: :?
Also, is it better for me to explicitly store the cookie.ASPXAUTH? And does it expire or automatically resume when necessary?
Thank,
Robbie
Robby Cohen Mar 29 '12 at 21:18 2012-03-29 21:18
source share