ideashower / ShareKit

Drop in sharing features for all iPhone and iPad apps
http://getsharekit.com
1.79k stars 375 forks source link

issue with logging out of Twitter - login browser remembers details #62

Closed tristanmartin closed 14 years ago

tristanmartin commented 14 years ago

Hi.

When I call [SHK logoutOfAll], permission for the Twitter application to post as me is revoked, however when I go to share another item, the web browser screen that was initially used to log in still remembers my log in details. Rather than having to enter my Twitter username and password again, all the user has to do is press one button to re-grant permission to the Twitter application.

Suppose you're creating Foursquare except using Sharekit. When the user logs out of Foursquare from the iPhone, and logs into another account on the same iPhone, they'll be able to post from the twitter account of the previous Foursquare user. This is a problem.

Hope that helps! Tristan

ideashower commented 14 years ago

Hey Tristan, Are you using OAuth or xAuth?

If using OAuth, you might have to clear out the cookies for the twitter domain. If that is the case, I'll add that to the list of issues.

tristanmartin commented 14 years ago

Hey ideashower,

I am using OAuth. I added this code to my app's log out method and now everything works fine.

//eat them cookies!!!
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *each in [[[cookieStorage cookies] copy] autorelease]) {
    [cookieStorage deleteCookie:each];
}
ideashower commented 14 years ago

This is fixed in 0.2.1 which should be released soon. Thanks!