AFNetworking如何获取http里面的cookie 可以删除cookie

1:获取cookie:

NSArray *array =  [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:url];

        NSDictionary *dict = [NSHTTPCookie requestHeaderFieldsWithCookies:array]


2:删除cookie:

for (NSHTTPCookie *cookie in array)

        {

            [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];

        }

你可能感兴趣的:(cookie,AFNetworking,ios开发,NSArray)