kerravonsen: Ninth Doctor: "thinking" (thinking)
Kathryn A. ([personal profile] kerravonsen) wrote in [community profile] perl 2011-09-10 11:17 pm (UTC)

However... I think you are on the right track. Because THAT cookie is one of the differences between LWP and wget.

The sequence of events is this:

1) Load cookies from the cookie file. Both LWP and wget read all the cookies correctly.
2) Send a GET request for the URL.

This is the GET request sent by wget:
------------------
GET /571792.html?format=light HTTP/1.0^M
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: tptigger.livejournal.com
Connection: Keep-Alive
Cookie: ljdomsess.tptigger=v1:u1359334:s1658:t1315566000:g4eff918a17f6712f1c4b55b3ee9e0102f99b6372//1; BMLschemepref=vertigo; __qca=P0-1371400743-1309003285157; __unam=37d207d-12e74531b06-113e375f-1000; __utma=48425145.223224461.1309003285.1309003285.1309003285.1; __utmc=48425145; __utmz=48425145.1309003285.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cart=; langpref=en_LJ/1314404400; ljloggedin=v1:u1359334:s1658:t1311802976:ga4e1c230bbbe55184ea4ac827346291cac618e59; ljsession=v1:u1359334:s1658:t1314403200:g3511fa97d76eb492f381533c9bc3f387de3f3059//1; ljuniq=ufTCu246eDSh5R5%3A1310599401%3Apgstats0; mlm-alert-read=; mlm-alert-start=; mlm-dialog-ary=; s_cc=true; s_sq=sixapartlivejournal%3D%2526pid%253Dhttps%25253A//www.livejournal.com/login.bml%2526oid%253DLog%252520in...%2526oidt%253D3%2526ot%253DSUBMIT; show_sponsored_styles=1; show_sponsored_vgifts=0; vertical_tags=1313106597%7Cvgam%3A6,vtec%3A6

------------------

This is the GET request sent by LWP:
------------------
GET http://tptigger.livejournal.com/571792.html?format=light
Connection: keep-alive
Accept-Encoding: gzip, x-gzip, deflate, x-bzip2
User-Agent: libwww-perl/5.837
Cookie: mlm-dialog-ary=; BMLschemepref=vertigo; ljloggedin=v1:u1359334:s1658:t1311802976:ga4e1c230bbbe55184ea4ac827346291cac618e59; __utmc=48425145; vertical_tags=1313106597%7Cvgam%3A6,vtec%3A6; mlm-alert-read=; s_cc=true; __utmz=48425145.1309003285.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); langpref=en_LJ/1314404400; s_sq=sixapartlivejournal%3D%2526pid%253Dhttps%25253A//www.livejournal.com/login.bml%2526oid%253DLog%252520in...%2526oidt%253D3%2526ot%253DSUBMIT; __unam=37d207d-12e74531b06-113e375f-1000; show_sponsored_styles=1; __utma=48425145.223224461.1309003285.1309003285.1309003285.1; ljuniq=ufTCu246eDSh5R5%3A1310599401%3Apgstats0; __qca=P0-1371400743-1309003285157; cart=; mlm-alert-start=; show_sponsored_vgifts=0; ljsession=v1:u1359334:s1658:t1314403200:g3511fa97d76eb492f381533c9bc3f387de3f3059//1
Keep-Alive: 300

------------------

I don't know why wget splits the URL into "Host" and the rest. I don't know if that is significant or not.

What I do think is significant is that wget sends ONE cookie that LWP doesn't send: ljdomsess.tptigger
Which I think is the very cookie you were talking about.

I do know that LWP loads that cookie; I've checked. It just doesn't send it, and I have no idea as to why. All the documentation about LWP and cookies says that you give LWP a cookie-jar and stand back and let LWP take care of it. But it isn't taking care of it. 8-(

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting