Reputation: 1858
How to maintain and clear sessions in a UIwebview in iphone sdk
Upvotes: 3
Views: 1619
Reputation: 3515
Just delete the cookies from the application. I used this for FBGraph as I was unable to logout from Facebook. You can use this.
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
NSString* domainName = [cookie domain];
NSRange domainRange = [domainName rangeOfString:@“yourDomainName"];
if(domainRange.length > 0)
{
[storage deleteCookie:cookie];
}
}
Upvotes: 1