hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugeny N Dzhurinsky <b...@redwerk.com>
Subject managing cookies in threads
Date Wed, 05 Jul 2006 11:36:39 GMT
Hello!

I using MultiThreadedHttpConnectionManager to manage connections in several
threads. In general, I'm using single instance of
MultiThreadedHttpConnectionManager for all threads which are using HttpClient.

private static MultiThreadedHttpConnectionManager connectionManager;

static {                                                                                 
                           
        connectionManager = new MultiThreadedHttpConnectionManager();                    
                               
        HttpConnectionManagerParams params = connectionManager.getParams();              
                               
        params.setMaxTotalConnections(1000);                                             
                               
        params.setStaleCheckingEnabled(true);                                            
                               
        params.setConnectionTimeout(CONNECTION_TIMEOUT);                                 
                               
        params.setSoTimeout(CONNECTION_TIMEOUT);                                         
                               
        params.setBooleanParameter("http.protocol.single-cookie-header", false);         
                               
        Protocol.registerProtocol("https", new Protocol("https",                         
                               
                new SelfSignedSSLSocketFactory(), 443));                                 
                               
    }

My question is: when some URI is handled, a cookie could be set, will that
cookie be used when creating new HttpClient instance with 
new HttpClient(connectionManager)?

If no, how can I implement this, so HttpClient will collect all cookies when
traversing a site?

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message