title: Unable to parse website after successful log in JSoup
body: <p>I successfully log into website using JSoup library, store the cookies so that i can use them for the second document where access is required. However the second document parses the data as if i am not logged in.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public class Main {
  
  public static void main(String[] args) throws Exception {
  
      Map&lt;String, String&gt; loginCookies = null;
  
  
       Connection.Response loginForm = Jsoup.connect("login page")
               .method(Connection.Method.GET)
               .execute();
  
       loginCookies = loginForm.cookies();
  
       Document document = Jsoup.connect("login page")
               .data("cookieexists", "false")
               .data("username", "user")
               .data("password", "pass")
               .data("loginbtn", "Log in")
               .cookies(loginCookies)
               .post();
  
  
      Document document2 = Jsoup.connect("Page with access required")
          .cookies(loginCookies)
          .get();
  
      System.out.println(document2);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What can be wrong with this code?</p>