清除新微博Cookie
在WBEngine.m文件里将如下方法里添加黑体部分代码,可清除Cookie,使登录后用islogin得到的标志位为更新后的标志位。
- (void)deleteAuthorizeDataInKeychain
{
self.userID = nil;
self.accessToken = nil;
self.expireTime = 0;
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStoragesharedHTTPCookieStorage];
for (cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}//清除cookie
NSString *serviceName = [[self urlSchemeString] stringByAppendingString:kWBKeychainServiceNameSuffix];
[SFHFKeychainUtilsdeleteItemForUsername:kWBKeychainUserIDandServiceName:serviceName error:nil];
[SFHFKeychainUtilsdeleteItemForUsername:kWBKeychainAccessTokenandServiceName:serviceName error:nil];
[SFHFKeychainUtilsdeleteItemForUsername:kWBKeychainExpireTimeandServiceName:serviceName error:nil];
}