Share cookies between android webview control and browser
How to share cookies between android webview control and browser.
I see that I can put cookies to webview, but I dont know how to 开发者_如何学Goget them from browser.
I tried few methods, but I never got exactly the same cookies as browser has.
For example:
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().sync();
CookieManager cookieManager = CookieManager.getInstance();
String cookie = cookieManager.getCookie("http://m.website.com");
I don't think what you are trying is possible. My understanding is that the cookie stored for webview will be stored in the application's sandbox and browser (is another application) will not have access to your application sandbox.
BTW, why do you want these cookies to be shared?
EDIT: CookieManager might do the trick, check this link out
http://developer.android.com/reference/android/webkit/CookieManager.html
精彩评论