title: Python requests login - the login page returned without an error
body: <p>I'm trying to login to a webpage using python requests and the result is the same login page, without any login error.</p>
  
  <p>This is the login form:</p>
  
  <pre><code>&lt;form method="post" action="login.php" id="yw0" class="well form-horizontal"&gt;
          &lt;div class="login"&gt;
                          &lt;div class="form"&gt;
                  &lt;div class="control-group"&gt;
                      &lt;label for="userInput" class="control-label required"&gt;Benutzer&lt;/label&gt;
                      &lt;div class="controls"&gt;
                          &lt;input type="text"
                                 name="loginName"
                                 maxlength="32"
                                 id="userInput"&gt;
                          &lt;span style="display:none" 
                                class="help-inline error"
                                id="VierCom_Base_Models_LoginForm_username_em_"&gt;&lt;/span&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="control-group"&gt;
                      &lt;label for="VierCom_Base_Models_LoginForm_password" class="control-label required"&gt;Passwort&lt;/label&gt;
                      &lt;div class="controls"&gt;
                          &lt;input type="password"
                                 name="loginPwd"
                                 maxlength="32"
                                 id="VierCom_Base_Models_LoginForm_password"&gt;
                              &lt;span style="display: none"
                                    class="help-inline error"
                                    id="VierCom_Base_Models_LoginForm_password_em_"&gt;&lt;/span&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="control-group"&gt;
                      &lt;div class="controls"&gt;
                          &lt;button type="submit"
                                  name="btnLogin"
                                  class="btn"&gt;Login&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>This is my python code:</p>
  
  <pre><code>import requests
  import re
  import requests.utils, pickle
  import argparse
  import time
  from bs4 import BeautifulSoup
  import csv
  
  user_field = "loginName"
  pass_field = "loginPwd"
  
  with requests.session() as c:
             login_url = 'https://login.professional-cockpit.de/login.php'
             after_login_url = 'https://login.professional-cockpit.de/qlikView.php'
  
             USERNAME = "*********"
             PASSWORD = "*********"
             c.get(login_url)
  
             login_data = dict(user_field=USERNAME,pass_field=PASSWORD)
  
             ### login to website
             res = c.post(login_url, data=login_data)
  
             print(res.text)
  </code></pre>
  
  <p>When i login from the browser, this is the Request headers:</p>
  
  <pre><code>POST /login.php HTTP/1.1
  Host: login.professional-cockpit.de
  Connection: keep-alive
  Content-Length: 51
  Cache-Control: max-age=0
  Origin: https://login.professional-cockpit.de
  Upgrade-Insecure-Requests: 1
  User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
  Content-Type: application/x-www-form-urlencoded
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Referer: https://login.professional-cockpit.de/login.php
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8,he;q=0.6,de;q=0.4
  Cookie: PHPSESSID=g28c793759o9nthgrhd0p99536
  </code></pre>
  
  <p>I tried everything and googled this many times.
  I would appreciate any help.</p>