Search code examples
iosobjective-cinstagraminstagram-api

Show Instagram login page


I am using login with Instagram in my application. Now when I logged out from my application and again want to logged in to app via Instagram. I want to show Instagram login Page, but it is giving authorised url and directly giving the user data which i used previously for logged in.


Solution

  • you need to clear the cache also, write the following code inside logged out button, for more information see this link

      [[NSURLCache sharedURLCache] removeAllCachedResponses];
             for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
    
            [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
    
        }