title: HttpClient: Can i safely reuse HttpContext for different domains by multiple threads?
body: <p>Can i safely reuse HttpClientContext to store cookies for different domains by multiple threads, or perhaps it's better to create one context for each domain, or even narrower, create one context for each thread per domain ?</p>
  
  <p>What i imagine is to behave like a browser that can handle cookies for each domains and which can open multiple tabs on pages that originates from the same or different domains.</p>
  
  <p>Here's how i initiate the context only once to be reusable by multiple threads :</p>
  
  <pre><code>HttpClientContext context = HttpClientContext.create();
  context.setCookieStore(this.createCookieStore());
  </code></pre>
  
  <p>I'm also using the latest version of the HttpClient.</p>