Skip to main content
Participating Frequently
Aug 16, 2013 8:00 PM UTC
Answered

How to clear the cookies of a StageWebView

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 is closed to new replies. Start a new post to keep the conversation going.
mbhagya
mbhagyaCorrect answer
Participating Frequently
Aug 16, 2013 8:19 PM UTC

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

7 replies

Participant
Jun 20, 2014 10:17 AM UTC

Hi,

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

https://github.com/plepers/ClearCookiesANE

Translate
mbhagya
mbhagyaCorrect answer
Participating Frequently
Aug 16, 2013 8:19 PM UTC

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

Translate
--udi--Author
Participating Frequently
Aug 16, 2013 8:26 PM UTC

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!

Translate
mbhagya
Participating Frequently
Aug 16, 2013 9:03 PM UTC

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

Translate