Android saves session cookies between application launches -- Is this expected? -
i have application in web view uses session cookies. (cookies deleted when browser closed). if login web application, , kill android app , load url again, session cookie still persists. not expected. known behavior?
here code:
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); string storeurl = intent.getstringextra("storeurl"); this.webview = (webview)findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.setwebviewclient(new webviewclient() { public void onpagefinished(webview view, string url) { } }); webview.loadurl(storeurl); }
afaik, android store cookies in ram
the cookiesyncmanager used synchronize browser cookie store between ram , permanent storage. best performance, browser cookies saved in ram
you can clear session cookies pro-grammatically, put onbackpressed
method when leave application clear session cookies.
cookiemanager cm = cookiemanager.getinstance(this); cm.removesessioncookie();
http://developer.android.com/reference/android/webkit/cookiemanager.html#removesessioncookie()
Comments
Post a Comment