Switch user or re authenticate with Instagram

旧街凉风 提交于 2019-12-01 16:10:48

Justin Powell answer is working for log out but I need to be also able to log in just after and it's quite anoying for Android

But it points me in the right direction : Instagram (like other website) maintains our login with session variable (so with cookies)

So to avoid to be always loged in, we just have to find and remove the correct cookie, here is how to do it with Android :

    String cookieString = "sessionid=''";
    CookieManager.getInstance().setCookie("instagram.com", cookieString);

With this I set the Instagram sessionid cookie to en empty string so Instagram doesn't recognize me anymore

JstnPwll

You could call the Instagram logout url (https://instagram.com/accounts/logout/) in the background before asking for access again. See this question and answers.

I believe the only other option is to leave it up to the user to logout of their Instagram account before loading your access url.

solved the same issue by deleting Access-Token from the app and loading url https://instagram.com/accounts/logout in webview without attaching it to any rootview.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!