> I am trying to use wget to update my IPv6 tunnel endpoint on > sonic.net. My plan is to use the two steps process described in the > man page, first saving a session cookie, then posting the updated IP > address to a different page on the site. I am stuck on getting a > working login with the below command. Any help appreciated. > > Thanks, > __ > Eric > > $ wget --no-check-certificate --keep-session-cookies --save-cookies > cookies.txt --post-data "user=mylogin&pw=mypassword" -S -dv > https://members.sonic.net/ > Setting --verbose (verbose) to 1 > DEBUG output created by Wget 1.12 on cygwin. > > URI encoding = `UTF-8' > --2011-02-05 07:22:57-- https://members.sonic.net/
[...] > ---request begin--- > POST / HTTP/1.0 > User-Agent: Wget/1.12 (cygwin) > Accept: */* > Host: members.sonic.net > Connection: Keep-Alive > Content-Type: application/x-www-form-urlencoded > Content-Length: 22 > > ---request end--- [...] > <div class="error" > style="padding-top:20px;padding-bottom:5px;text-align:center;">Please > enable cookies for members.sonic.net</div> The server requires a PHPSESSID cookie be set before login. The FAQ has an example that saves a session cookie after login but not before login. So in a situation like yours you'd typically have an additional step. You'd have to access the page with the login form first to get a valid session cookie before attempting to post. However it happens the way they have their server setup you can pass in a blank PHPSESSID when you POST and it should assign you a valid one and at the same time allow your login. That's my theory, anyway. If I pass this Cookie: PHPSESSID= I get a valid session in the reply and no cookie error message. printf "members.sonic.net\tFALSE\t/\tTRUE\t0\tPHPSESSID\t" > sonic.txt I suggest that you not disable certificate checking. Check this from yesterday for help http://www.mail-archive.com/[email protected]/msg01579.html So first either set a blank session cookie (described above) or better just get one: wget --save-cookies=sonic.txt --keep-session-cookies https://members.sonic.net/ Then login: wget --load-cookies=sonic.txt --save-cookies=sonic.txt --keep-session-cookies --post-data="user=a&pw=b" https://members.sonic.net/ Jay
