I’m using WebViews for login in to social networks like Facebook, Twitter, Windows live etc. (all based on OAuth) for posting information directly from the game. The workflow is managed server-side and also the OAuth tokens are persisted there. I provide a logout button which invalidates the OAuth tokens server side.
As it appears the WebView is actually persisting cookies permanently (so even after the application has been closed). The problem is now that on some sites the user can choose the server to remember the login based on cookies. So if the user login again it will be automatically the same user as last time and cannot change the user anymore. The only way is to de-install the app or wait until the cookie expires (which can take a long time).
Therefore can you please add a function to remove the cookies from the WebView?
On iOS it can be achieved with the following Objective-C code:
You could possibly initiate a logout in the webview - which should then delete or expire the cookies like a normal web request would. This is similar to a browser persisting cookies and then you hitting logout and the cookies are gone.
I’d like to renew the request for cookie deletion as well. This is not a new request, and I don’t believe our friends at Corona have ever given us an answer. Remember this thread was, ahem, started in 2011…
The above post in this thread says “WebView is actually persisting cookies permanently” even after the application is closed, and the only way to remove them “is to de-install the app or wait until the cookie expires.” Which could take until the end of the 32-bit Unix epoch in 2038 or so.
You could possibly initiate a logout in the webview - which should then delete or expire the cookies like a normal web request would. This is similar to a browser persisting cookies and then you hitting logout and the cookies are gone.
I’d like to renew the request for cookie deletion as well. This is not a new request, and I don’t believe our friends at Corona have ever given us an answer. Remember this thread was, ahem, started in 2011…
The above post in this thread says “WebView is actually persisting cookies permanently” even after the application is closed, and the only way to remove them “is to de-install the app or wait until the cookie expires.” Which could take until the end of the 32-bit Unix epoch in 2038 or so.
I have attempted to implement this method, but it does not appear to work. I use webviews in my app to access content on a website that requires the user to log in. When logging out of my app, I would like to delete the cookies from the webview, and thus log the user out of the website as well. However, when I implement the following code, I find that I am stilled logged in:
[lua]
local webView = native.newWebView(0, 0, 1, 1)
webView:deleteCookies()
webView:removeSelf()
[/lua]
In the documentation it states that the method “deleteCookies()” deletes the cookies for all webViews, but this does not appear to be the case.
I have attempted to implement this method, but it does not appear to work. I use webviews in my app to access content on a website that requires the user to log in. When logging out of my app, I would like to delete the cookies from the webview, and thus log the user out of the website as well. However, when I implement the following code, I find that I am stilled logged in:
[lua]
local webView = native.newWebView(0, 0, 1, 1)
webView:deleteCookies()
webView:removeSelf()
[/lua]
In the documentation it states that the method “deleteCookies()” deletes the cookies for all webViews, but this does not appear to be the case.