title: Using Jsoup to POST login data
body: <p>I'm trying to log into this website: <a href="http://deeproute.com" rel="nofollow">http://deeproute.com</a></p>
  
  <p>This is my code.</p>
  
  <pre><code>            Connection.Response res = null;
              Connection homeConnection = null;
              Document homePage = null;
              Map&lt;String, String&gt; loginCookies = null;
              try {
                  res = Jsoup.connect("http://www.deeproute.com/")
                          .data("cookieexists", "false")
                          .data("name", user)
                          .data("password", pswd).method(Method.POST)
                          .execute();
  
              } catch (IOException e) {
  
                  e.printStackTrace();
              }
  
              if (res != null) {
  
                  loginCookies = res.cookies();
  
                  try {
                      homePage = Jsoup.connect("http://www.deeproute.com")
                              .cookies(loginCookies).get();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
  </code></pre>
  
  <p>Unfortunately, this simply returns the same page in a not-logged-in state. What am I doing wrong?</p>