Delete cookies from WebView

What happens if you try the sample code here?

https://github.com/coronalabs/sdk-sample-deleteCookies/tree/master

You will probably need to change the URL…

Rob

I’ve tried the sample code and it still does not work. 

I’m using build 2014.2511

Does the deleteCookies function employ a JavaScript call?

Ok, I’ve discovered that it works on a device, but not on the simulator. 

Good to know.

The deleteCookies call for web views doesn’t work for OS X builds either.

I am also using webviews to login in to social networks based on OAuth, so I am running into the same problem as teichmann, when trying to port my mobile apps to desktop apps.

Any chance this will be fixed soon?

Thanks.

I’d also request that this bug be fixed. Thanks!

We will need a bug report.  Please include a sample project that demonstrates the problem. It needs to be complete (main.lua, config.lua, build.settings and any resources needed to build the app). Put all this in a .zip file (please no other formats) and use the Report a bug link at the top of the page. Please refer to this post in the the text of the bug report. You will get a confirmation email. That email will have a CaseID number. Please post that back here.

Thanks

Rob

The deleteCookies call for web views doesn’t work for OS X builds either.

I am also using webviews to login in to social networks based on OAuth, so I am running into the same problem as teichmann, when trying to port my mobile apps to desktop apps.

Any chance this will be fixed soon?

Thanks.

I’d also request that this bug be fixed. Thanks!

We will need a bug report.  Please include a sample project that demonstrates the problem. It needs to be complete (main.lua, config.lua, build.settings and any resources needed to build the app). Put all this in a .zip file (please no other formats) and use the Report a bug link at the top of the page. Please refer to this post in the the text of the bug report. You will get a confirmation email. That email will have a CaseID number. Please post that back here.

Thanks

Rob

Where are the cookies stored on the device that the new method deletes them from?

  1. webView:deleteCookies()

I’m trying to figure out if the cookies are always erased when an app is updated in the store and downloaded by the user.  Are they in the documents directory or resource directory somewhere?

WebView cookies are stored by the device’s operating system.  The location will vary by OS and I’m pretty sure it’s opaque to apps.

We’re aware of the issue with webView:deleteCookies() not working on OS X.  Unfortunately, OS X shares cookies between all webview instances (including Safari) so enabling CoronaSDK apps to delete all of them would have surprising side-effects.  We’re looking at what we can do to provide a workaround for this.  If you are comfortable with HTTP headers and cookie management you can remove cookies yourself by manipulating the headers in a network.request() but this is something you’d need to research.

Where are the cookies stored on the device that the new method deletes them from?

  1. webView:deleteCookies()

I’m trying to figure out if the cookies are always erased when an app is updated in the store and downloaded by the user.  Are they in the documents directory or resource directory somewhere?

WebView cookies are stored by the device’s operating system.  The location will vary by OS and I’m pretty sure it’s opaque to apps.

We’re aware of the issue with webView:deleteCookies() not working on OS X.  Unfortunately, OS X shares cookies between all webview instances (including Safari) so enabling CoronaSDK apps to delete all of them would have surprising side-effects.  We’re looking at what we can do to provide a workaround for this.  If you are comfortable with HTTP headers and cookie management you can remove cookies yourself by manipulating the headers in a network.request() but this is something you’d need to research.