title: Logging in to a website with Jsoup which redirects, and scraping a page that isn't the redirect
body: <p><a href="http://interpals.net" rel="nofollow">This</a> is the website I'm trying to scrape from.</p>
  
  <p>I'm able to login to the website fairly easily. However, I'm unable to retrieve and reuse the cookies or session ID to scrape a page other than the one the login page redirects to. I receive a 403 everytime. </p>
  
  <p>Here is an example of what I've tried:</p>
  
  <pre><code>try
  {
      String userAgent = "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0";
  
      Connection.Response res = Jsoup.connect("http://www.interpals.net/login.php")
              .data("action", "login")
              .data("login", username)
              .data("password", password)
              .data("auto_login", "1")
              .userAgent(userAgent)
              .method(Connection.Method.POST)
              .followRedirects(false)
              .execute();
  
      res.parse();
      String sessionID = res.cookie("interpals_sessid");
  
      Document doc = Jsoup.connect("http://www.interpals.net/friends.php").cookie("interpals_sessid", sessionID).get();
  </code></pre>