title: Grabbing a cookie after clicking login?
body: <p>Hi I'm making an android app that requires data that I need to login to a website to get. I've worked with JSoup before so I've been trying to use that for all of my html scraping here.</p>
  
  <p>Basically the flow of things is I go to the login site using this code</p>
  
  <pre><code>LOGIN is the URL
  
  Connection.Response res = Jsoup.connect(LOGIN)
              .data("username", "/*username*/")
              .data("password", "/*password*/")
              .method(Method.POST)
              .execute();
  
  //get the cookies and save it in the sessionId string
  Map&lt;String, String&gt; loginCookies = res.cookies();
  </code></pre>
  
  <p>Then later I'll go to another site and need to use the cookies. The problem is there's one cookie that I seem to be missing out on. I get the cookie that I have observed through the cookie monster addon to be added when just accessing the page, before pressing login. Then right after pressing log in there's another cookie added in the browser that is not in my app, and it is essential to maintaining my login status. </p>
  
  <p>So how can I get this rogue cookie that is added after pressing the button?</p>
  
  <p>I've looked at several postings on here and I've learned a lot about working with cookies, </p>
  
  <p><a href="https://stackoverflow.com/questions/7206133/sending-post-request-and-save-cookies">Sending POST request with username and password and save session cookie</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6432970/jsoup-posting-and-cookie">jsoup posting and cookie</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7139178/jsoup-cookies-for-https-scraping">Jsoup Cookies for HTTPS scraping</a></p>
  
  <p>are the questions I've poured over already....</p>
  
  <p>thanks in advance!</p>