Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/com/androidquery/callback/AbstractAjaxCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,13 @@ public static void setProxyHandle(ProxyHandle handle){
proxyHandle = handle;
}

private static CookieStore _cookieStore;

public static CookieStore getCookieStore() {
if (_cookieStore == null) _cookieStore = new BasicCookieStore();
return _cookieStore;
}


private void httpDo(HttpUriRequest hr, String url, AjaxStatus status) throws ClientProtocolException, IOException{

Expand Down Expand Up @@ -1671,14 +1678,10 @@ private void httpDo(HttpUriRequest hr, String url, AjaxStatus status) throws Cli
hr.addHeader("Cookie", cookie);
}



HttpParams hp = hr.getParams();


if(proxy != null) hp.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);


if(timeout > 0){
hp.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout);
hp.setParameter(CoreConnectionPNames.SO_TIMEOUT, timeout);
Expand All @@ -1688,9 +1691,8 @@ private void httpDo(HttpUriRequest hr, String url, AjaxStatus status) throws Cli
hp.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false);
}

HttpContext context = new BasicHttpContext();
CookieStore cookieStore = new BasicCookieStore();
context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
HttpContext context = new BasicHttpContext();
context.setAttribute(ClientContext.COOKIE_STORE, getCookieStore());

request = hr;

Expand Down