我在我的应用程序中使用了foursquare,但我无法从我的应用程序中的foursquare 注销。
问问题
117 次
2 回答
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];
}
}
于 2013-01-29T06:41:07.090 回答
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];
};
}
于 2013-01-29T06:37:00.937 回答