Rascagua New member Jun 18, 2007 281 3 0 Apr 10, 2008 #1 Im trying to login to a site that requires cookies to stay logged in... but I cant get it to store any cookies... im running the scripts of my localhost... its all curl, can you point me to a tutorial or something! THANK You very much.
Im trying to login to a site that requires cookies to stay logged in... but I cant get it to store any cookies... im running the scripts of my localhost... its all curl, can you point me to a tutorial or something! THANK You very much.
Stanley Banned Jun 24, 2006 3,399 43 0 San Diego Apr 10, 2008 #2 it'll be easier to help you if you post your code
DavidR New member Aug 23, 2006 508 10 0 WA Apr 10, 2008 #3 Code: import pycurl def setup_curl(url): c = pycurl.Curl() c.setopt(pycurl.URL, url) c.setopt(pycurl.COOKIEFILE, '') return c
Code: import pycurl def setup_curl(url): c = pycurl.Curl() c.setopt(pycurl.URL, url) c.setopt(pycurl.COOKIEFILE, '') return c
S Skittled New member Oct 16, 2007 84 0 0 Apr 12, 2008 #4 I've set the cookie file and cookie jar options to the same value. This may not be correct usage but it works for me. Code excerpt (don't use Python; this is in PHP but should be pretty obvious): Code: $curl= curl_init($URL); $cookiefile="cookie"; ... curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiefile); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiefile); # SAME cookiefile ... Last edited: Apr 12, 2008
I've set the cookie file and cookie jar options to the same value. This may not be correct usage but it works for me. Code excerpt (don't use Python; this is in PHP but should be pretty obvious): Code: $curl= curl_init($URL); $cookiefile="cookie"; ... curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiefile); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiefile); # SAME cookiefile ...