Alex Egg
2011-Jul-11 03:11 UTC
[Mechanize-users] Mechanize doesn''t add cookies to request
These are my cookies: pp agent.cookies
[SESS0d5421b77d41416bd1d57db5eba42384=aaa86QA6Nf_ISbkcjkxet,
bbsessionhash=b5af88de76a01ee20340a88dc433793d,
bblastvisit=1310353559,
bblastactivity=1310353559,
bbuserid=6425,
bbpassword=4afd254205b86456d8e4d7ce969f634d,
JSESSIONID=aaaJhfsv_RHIWfp2ikxet]
However when I make request: page = agent.get("https://asdf.com/fdsa")
The cookies aren''t added to the request:
D, [2011-07-10T20:07:35.523103 #47281] DEBUG -- : saved cookie:
SESS0d5421b77d41416bd1d57db5eba42384=aaaXsYX8MGC8XdPzGkxet
D, [2011-07-10T20:07:35.523477 #47281] DEBUG -- : saved cookie:
SESS0d5421b77d41416bd1d57db5eba42384=aaaqEBLpnek9AgkBGkxet
D, [2011-07-10T20:07:35.523822 #47281] DEBUG -- : saved cookie:
bbsessionhash=bd5f66648bbfeb3e6ad09d3cba6d0a29
D, [2011-07-10T20:07:35.524147 #47281] DEBUG -- : saved cookie:
bblastvisit=1310353655
D, [2011-07-10T20:07:35.524466 #47281] DEBUG -- : saved cookie:
bblastactivity=1310353655
D, [2011-07-10T20:07:35.524788 #47281] DEBUG -- : saved cookie:
bbuserid=6425
D, [2011-07-10T20:07:35.525111 #47281] DEBUG -- : saved cookie:
bbpassword=4afd254205b86456d8e4d7ce969f634d
I, [2011-07-10T20:07:35.525216 #47281] INFO -- : follow redirect to:
https://asdf.com/fdsa
I, [2011-07-10T20:07:35.529606 #47281] INFO -- : Net::HTTP::Get: /fdsa
D, [2011-07-10T20:07:35.529671 #47281] DEBUG -- : request-header: accept =>
*/*
D, [2011-07-10T20:07:35.529712 #47281] DEBUG -- : request-header: user-agent
=> Mechanize/2.0.1 Ruby/1.9.2p180 (http://github.com/tenderlove/mechanize/)
D, [2011-07-10T20:07:35.529751 #47281] DEBUG -- : request-header:
accept-encoding => gzip,deflate,identity
D, [2011-07-10T20:07:35.529790 #47281] DEBUG -- : request-header:
accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7
D, [2011-07-10T20:07:35.529828 #47281] DEBUG -- : request-header:
accept-language => en-us,en;q=0.5
D, [2011-07-10T20:07:35.529866 #47281] DEBUG -- : request-header: cookie =>
JSESSIONID=aaa8ieMR1av0S-XwGkxet
D, [2011-07-10T20:07:35.529903 #47281] DEBUG -- : request-header: host =>
asdf.com
I, [2011-07-10T20:07:35.854720 #47281] INFO -- : status: Net::HTTPForbidden
1.1 403 Forbidden
The login fails b/c the 7 cookies aren''t in the request. Why is this
happening?
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/mechanize-users/attachments/20110710/a5de93d3/attachment.html>