Right now I can login to <a href="http://www.phpbb.com">www.phpbb.com</a>'s forums<br><br>import httplib, urllib<br>params = urllib.urlencode({'username':'TheInfernoSin','password':'PASSWORD','login':1,'sid':'','redirect':'index.php','autologin':1})<br>
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}<br>con = httplib.HTTPConnection(url)<br>con.request("POST","/community/ucp.php?mode=login",params,headers)<br>
data = con.getresponse()<br>#print data.read()<br>hdrs = data.getheader('set-cookie')<br>header = {"Cookie": hdrs}<br>print header<br>#print hdrs<br><br>con2 = httplib.HTTPConnection(url)<br>#con2.request("GET","/community/ucp.php",None,header)<br>
con2.connect()<br>con2.putrequest("POST","/community/ucp.php")<br>con2.putheader("Cookie",hdrs)<br>con2.endheaders()<br>data = con2.getresponse()<br>print data.read()<br><br>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.<br>