Right now I can login to www.phpbb.com's forums
import httplib, urllib
params =
urllib.urlencode({'username':'TheInfernoSin','password':'PASSWORD','login':1,'sid':'','redirect':'index.php','autologin':1})
headers = {"Content-type": "application/x-www-form-urlencoded","Accept":
"text/plain"}
con = httplib.HTTPConnection(url)
con.request("POST","/community/ucp.php?mode=login",params,headers)
data = con.getresponse()
#print data.read()
hdrs = data.getheader('set-cookie')
header = {"Cookie": hdrs}
print header
#print hdrs
con2 = httplib.HTTPConnection(url)
#con2.request("GET","/community/ucp.php",None,header)
con2.connect()
con2.putrequest("POST","/community/ucp.php")
con2.putheader("Cookie",hdrs)
con2.endheaders()
data = con2.getresponse()
print data.read()
The first block of code logins in and if printed it'll show the logged in
successful html code, but when trying to go to another page and sending that
cookie back to the server, it wont allow me to stay logged in.
--
http://mail.python.org/mailman/listinfo/python-list