Skip to main content
Participating Frequently
August 16, 2013
Answered

How to clear the cookies of a StageWebView

  • August 16, 2013
  • 2 replies
  • 3974 views

Hello,

I'm working with StageWebView with Instagram's OAuth. When I first log in on a device the StageWebView shows Instagram's log in page so the user can enter a username and password and the log in is successful. The problem is when I try to log out, at this point I try to open the Instagram's log in page in the StageWebView again but this time the StageWebView just logs in using the username and password given earlier, it looks like it saves them in a cookie somewhere.

My question is how can I clear this cookie so that I will be able to log in as a different user?

Thanks!

This topic has been closed for replies.
Correct answer mbhagya

Udi,

If you wish to log a user out of Instagram, I think you should not open the login page again. Rather, you should open this page https://instagram.com/accounts/logout/ in the webview.

When successful, you can change the URL to login page again.

-mayank

2 replies

Participant
June 20, 2014

Hi,

You can find an ANE to do it on IOs and (maybe) android

https://github.com/plepers/ClearCookiesANE

mbhagya
mbhagyaCorrect answer
Participating Frequently
August 16, 2013

Udi,

If you wish to log a user out of Instagram, I think you should not open the login page again. Rather, you should open this page https://instagram.com/accounts/logout/ in the webview.

When successful, you can change the URL to login page again.

-mayank

--udi--Author
Participating Frequently
August 16, 2013

Hi mayank,

Thanks for your reply.

I just tried it and it seems to work perfectly! I can't believe I haven't thought of that .

Even though it does solve my current problem I would still like to know where the StageWebView saves its cookies and if there is a way to clear them. Do you have any idea?

Thanks!

mbhagya
Participating Frequently
August 16, 2013

Udi,

I am not sure but being a 'StageWebView', they must be relying upon the operating system's webview for cookie management.

Which platform are you writing this for? iOS?

-mayank