I have a WebView which allows a user to share an image to facebook. This process involves them logging into FB. After they're done I destroy the WebView and the app resets and a different user is offered the same functionality. The intention is for the WebView to not to remain logged in from one session to the next, however, I'm unclear on how to either manually log the user out at the end of their session (calling http://www.facebook.com/logout.php no longer works, apparently), and grabbing new instances of WebView and WebChromeClient doesn't do it either.
However, I notice that when I reinstall the application (as I modify it) the log in is cleared, so, I'm assuming that *somehow Webkit can tell that this is a different app (as it is uninstalled and re-installed) and I'm hoping I can leverage this (or any other) mechanism to clear whatever it is that holds the user's login info... I'm guessing it's a cookie, but I'm not entirely certain that it is.
I'm sure I'm not the first person to need to log the user out of FB manually, but not via my own oAuth (since I'm not the one logging them in).
It's set by cookie. Prior to API 21 use:
android.webkit.CookieManager.getInstance().removeAllCookie();
now this method has been replaced with removeAllCookies
which is basically the same but asynchronous with a callback.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With