title: Trying to load cookies with url in android webview
body: <p>I am trying to load cookie in android web view. following is my java code.</p>
  
  <pre><code>final String link = "http://www.iitjeeacademy.com/mobile/question/CHE/AAH";
  
  final String domain = "iitjeeacademy.com";
  
  String authToken = LoginService.getCookie();
  
  String cookie = "auth-token=" + authToken + "; csrf-token=mobile";
  
  webView = (WebView) findViewById(R.id.webView);
  
  Map&lt;String, String&gt; cookieMap = new HashMap&lt;String, String&gt;();
  
  cookieMap.put("Cookie", cookie);
  
  
  android.webkit.CookieSyncManager.createInstance(QuestionActivity.this);
  android.webkit.CookieManager.getInstance().setAcceptCookie(true);
  
  WebkitCookieManagerProxy coreCookieManager = new WebkitCookieManagerProxy(null, java.net.CookiePolicy.ACCEPT_ALL);
  
  java.net.CookieHandler.setDefault(coreCookieManager);
  
  android.webkit.CookieSyncManager.getInstance().sync();
  
  final WebSettings settings = webView.getSettings();
  settings.setLoadsImagesAutomatically(true);
  settings.setJavaScriptEnabled(true);
  settings.setDomStorageEnabled(true);
  
  webView.setWebViewClient(new CustomBrowser());
  webView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
  webView.loadUrl(link, cookieMap);
  
  private class CustomBrowser extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url){
          view.loadUrl(url);
          return true;
      }
  }
  </code></pre>
  
  <p>WebView <strong>layout.xml</strong></p>
  
  <pre><code>&lt;WebView
      android:id="@+id/webView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/&gt;
  </code></pre>
  
  <p>I tried to implement <strong>WebkitCookieManagerProxy</strong> for custom cookie storage as shown in -> <a href="https://stackoverflow.com/questions/12731211/pass-cookies-from-httpurlconnection-java-net-cookiemanager-to-webview-android">Pass cookies from HttpURLConnection (java.net.CookieManager) to WebView (android.webkit.CookieManager)</a>.</p>
  
  <p>But it is not working. When I run this code, in web view I am getting redirected to index page of site...</p>