title: How to use cookies in Python Requests
body: <p>I am trying to login to a page and access another link in the page.</p>
  
  <pre><code>payload={'username'=&lt;username&gt;,'password'=&lt;password&gt;}
  with session() as s:
      r = c.post(&lt;URL&gt;, data=payload)
      print r
      print r.content
  </code></pre>
  
  <p>This is giving me a "405 Not Allowed" error.
  I checked the post method details using chrome developer tools and could see an api (URL/api/auth).
  I posted to that URL with the payload and it was working and i was getting a response similar to what i could see in the developer.</p>
  
  <p>Unfortunately when trying to 'get' another url after login, i am still getting the content from the login page. 
  Why is the login not sticking? Should i use cookies?
  I am a newbie, so i don't really know how to work with cookies.</p>