I am facing issues with setting cookie in Android WebView. I am using the following code:
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
cookieManager.setAcceptCookie(true);
cookieManager.setCookie(url, cookie);
CookieSyncManager.getInstance().sync();
But it's not working. I also tried by adding headers using WebView's loadUrl(String url, Map<String, String> additionalHttpHeaders)
method; but still it's not working. Is there a way to do this?