我在我的应用程序中使用foursquare,但我不能在我的应用程序中从foursquare注销。
答案 0 :(得分:1)
将以下代码用于应用
中的remove
foursquare
cookie
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
NSString* domainName = [cookie domain];
NSRange domainRange = [domainName rangeOfString:@"foursquare"];
if(domainRange.length > 0)
{
[storage deleteCookie:cookie];
}
}
答案 1 :(得分:0)
你需要在任何你想要的地方打电话
NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie* cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
if ([cookie.name isEqualToString:@"FourSquare"]) {//its temprory name for your understanding
[cookies deleteCookie:cookie];
};
}