Yes, your session ID should be sent automatically after logging in, if the cookie does not expire before the next request is sent (an important detail to be sure). NSURLConnection , which uses AFNetworking, takes care of the details for this for you.
The backend network AFNetworking uses NSURLConnection , which in turn automatically updates NSHTTPCookieStorage to store the session. You can manipulate or delete cookies as you wish by tinkering with the cookie storage.
As if you wanted the service not to appear in the log, you can simply delete the session cookie associated with this domain. Some of the services I worked with will be erroneous if you are already logged in and are trying to log in again. In addition, it was not possible to check the login status. Quick fix, extract the cookies from the URL and delete them:
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL: networkServerAddress]; for (NSHTTPCookie *cookie in cookies) { [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; }
From the developer himself
Michael Boselowitz Jun 14 '12 at 19:10 2012-06-14 19:10
source share