title: Java applet - delete/ignore all cookies (JSoup)
body: <p>I've written a Java applet which gets HTML content from multiple pages from a single host and extracts data from it. I use Jsoup and it's working perfectly, but it automatically uses cookies for that host set in the browser and sends newly set cookies on subsequent requests. (I believe this is done natively by Java)</p>
  
  <p>I want it to ignore all cookies set by the server when the applet is run and ignore any cookies that the browser may already have.</p>
  
  <p>My code is very simple.</p>
  
  <pre><code>String url = "http://example.com/my/web-page.html";
  Document document = Jsoup.connect(url).userAgent("&lt;hard-coded static value&gt;").get();
  // Extract data from document with org.Jsoup.nodes.Document.select(), etc.
  </code></pre>
  
  <p>This repeats with multiple URLs, all having the same host (example.com).</p>
  
  <p>In summary, I basically want it to:</p>
  
  <ol>
  <li>Ignore any cookies for example.com that might be set in the browser.</li>
  <li>If the server sets any new cookies when the applet makes a request, ignore it for subsequent requests. If possible, also block the cookie from being stored in the browser.</li>
  </ol>
  
  <p>I've searched a lot and haven't been able to find a solution. I'd really appreciate any amount of help. I don't mind using Apache HTTPClient or any other third-party library, but I'd prefer not to so I can keep the applet's file size small.</p>
  
  <p>Thanks a ton in advance :)</p>