Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 13541
Status: resolved
Priority: 0/
Queue: Test-WWW-Mechanize

People
Owner: Nobody in particular
Requestors: MSCHOUT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: _check_links_status() looses cookie_jar
In _check_links_status, $self->clone() is called to clone the mechanize object. Unfortunately clone() does not copy the cookie_jar over to the clone()'d object. This causes problems for me because I am using cookies for authentication, and I want to set a cookie in the mechanize object before calling $mech->links_ok(). If I do not have the cookie set, I get "403" responses for pages that require authentication, which causes links_ok() to (correctly) report that some links were not valid. This should probabably be fixed in LWP::UserAgent, but a workaround is to just add this line in _check_links_status() after the clone() call: $mech->{cookie_jar} = $self->cookie_jar; # clone() drops cookie_jar I am going to report the problem with clone() to the LWP maintainer as well. I will leave it up to you if you want to do anything to work around this problem in Test::WWW::Mechanize or not :). I am not sure if the LWP maintainer will do anything about this or not. Regards, Michael Schout
Date: Tue, 5 Jul 2005 14:12:00 -0500
From: Andy Lester <andy [...] petdance.com>
To: via RT <bug-Test-WWW-Mechanize [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #13541] _check_links_status() looses cookie_jar
RT-Send-Cc:
On Tue, Jul 05, 2005 at 01:29:37PM -0400, via RT (bug-Test-WWW-Mechanize@rt.cpan.org) wrote: Show quoted text
> I am not sure if the LWP maintainer will do anything about this or not.
I'm not sure what Gisle will do. Please link the two tickets in RT, though. Thanks, xoxo, Andy -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance
Show quoted text
> I'm not sure what Gisle will do. Please link the two tickets in RT, > though.
Hrm, I get "permission denied" error when I try to establish a relationship between the tickets. The related LWP ticket I have opened is # 13542 Best Regards, Michael Schout
From: mark [...] summersault.com
Since there's been no respones on the LWP side, I commited a clone() method to SVN for WWW::Mechanize which should fix this in the next release. Mark On Tue Jul 05 13:29:37 2005, MSCHOUT wrote: Show quoted text
> In _check_links_status, $self->clone() is called to clone the mechanize > object. Unfortunately clone() does not copy the cookie_jar over to the > clone()'d object. > > This causes problems for me because I am using cookies for > authentication, and I want to set a cookie in the mechanize object > before calling $mech->links_ok(). If I do not have the cookie set, I > get "403" responses for pages that require authentication, which causes > links_ok() to (correctly) report that some links were not valid. > > This should probabably be fixed in LWP::UserAgent, but a workaround is > to just add this line in _check_links_status() after the clone() call: > > $mech->{cookie_jar} = $self->cookie_jar; # clone() drops cookie_jar > > I am going to report the problem with clone() to the LWP maintainer as > well. I will leave it up to you if you want to do anything to work > around this problem in Test::WWW::Mechanize or not :). > > I am not sure if the LWP maintainer will do anything about this or not. > > Regards, > Michael Schout