public void prepareForBrowser() { // Clear cookies, let the browser handle them httpClient.setCookieStore(new BlankCookieStore()); httpClient.getCookieSpecs().register("easy", new CookieSpecFactory() { @Override public CookieSpec newInstance(final HttpParams params) { return new BrowserCompatSpec() { @Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { // easy! } }; } }); httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, "easy"); decompress = false; setFollowRedirects(false); }
private void prepairCookieStore(DefaultHttpClient client) { client.setCookieStore(cookieStore); CookieSpecFactory csf = new CookieSpecFactory() { public CookieSpec newInstance(HttpParams params) { return new BrowserCompatSpec() { @Override public void validate(Cookie cookie, CookieOrigin origin) throws MalformedCookieException { // not filtering; accept all cookies Log.d(this.toString(),"cookies"); } }; } }; client.getCookieSpecs().register("all", csf); client.getParams().setParameter( ClientPNames.COOKIE_POLICY, "all"); }