Skip to content

Session Cookies in WebView

Krishna Eedula edited this page Apr 24, 2018 · 1 revision

Android webview does not clear session cookies after app is closed. You can handle this with sample code below:

CookieSyncManager.createInstance(getApplicationContext());
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeSessionCookie();
CookieSyncManager.getInstance().sync();

More about cookies here: CookieSyncManager

Clone this wiki locally