from urllib.parse import urlencode
data = urlencode(dict(username='testuser', password=md5encode('testpassword')))
response = opener.open('http://site.com/login', data)
Python CookieJar saves cookie, but doesn't send it to website