On Sat, 2022-07-02 at 10:11 +0000, Gordon Ross wrote:
> My simplified code is:
> 
> void makeRequest(final CloseableHttpClient httpClient) {
>   URIBuilder uriBuilder = new URIBuilder();
>   //Build up URI
>   HttpPost httpPost = new HttpPost(uriBuilder.build());
>   String body = "...";
>   httpPost.setEntity(new StringEntity(body));
>   HttpClientContext sessionContext = HttpClientContext.create();
>   HttpResponse response = httpClient.execute(httpPost,
> sessionContext);
> }
> 
> 
> PoolingHttpClientConnectionManager cm = new
> PoolingHttpClientConnectionManager();
> HttpClientBuilder httpClientBuilder = HttpClients.custom();
> httpClientBuilder.setConnectionManager(cm);
> httpClient = httpClientBuilder.build();
> 
> //First Request
> makeRequest(httpClient);
> //Second Request
> makeRequest(httpClient);
> 
> 
> Looking at the org.apache.hc.client5.http.headers logs, I can see in
> the second request cookies being sent to the server that were send
> back by the server in the first request.
> 
> As I’m creating a brand new HttpClientContext() for each request,
> surely the cookie stores should be separate?
> 
> What have I misunderstood?
> 
> Thanks,
> 

Post the _complete_ wirelog of the session. Feel free to obfuscate
whatever bits you deem sensitive.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to