Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

goldenlife

macrumors newbie
Original poster
Oct 2, 2010
24
0
Hi All,

I have used this code for logout from facebook. but it doesn't properly logout from the facebook. it doesn't ask for new login credentials.

NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
NSString* domainName = [cookie domain];
NSRange domainRange = [domainName rangeOfString:mad:"facebook"];
if(domainRange.length > 0)
{
[storage deleteCookie:cookie];
}
}
but it seems it doesn't delete facebook cookies.
I tried to print [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]
to see cookies list, but it seems empty.

How can I delete facebook login cookies? so that user can logout and login from the new user account, not same.

I have done changes in Authorize function of facebook also
[self authorizeWithFBAppAuth:YES safariAuth:NO];

if I make this then logout function works but login page get opened in webview not in safari.
I want to open login page in safari itself from my app.
Anybody can tell me how to do successfully logout from facebook and open login page in safari?

Thanks,
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.