title: How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie?
body: <p>(ClientCookie is a module for (automatic) cookie-handling: <a href="http://wwwsearch.sourceforge.net/ClientCookie" rel="nofollow noreferrer">http://wwwsearch.sourceforge.net/ClientCookie</a>)</p>
  
  <pre><code># I encode the data I'll be sending:
  data = urllib.urlencode({'username': 'mandark', 'password': 'deedee'})
  
  # And I send it and read the page:
  page = ClientCookie.urlopen('http://www.forum.com/ucp.php?mode=login', data)
  output = page.read()
  </code></pre>
  
  <p>The script doesn't log in, but rather seems to get redirected back to the same login page asking it for a username and password. What am I doing wrong?</p>
  
  <p>Any help would be greatly appreciated! Thanks!</p>