Re: LWP ->set_cookie

"Robert G. Werner" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Organization In Reach Technology
Message-ID <[email protected]>
Andy Lester wrote:
> What's goin' on here?
> 
> #!/usr/bin/perl
> 
> use HTTP::Cookies;
> 
> use Data::Dumper;
> 
> my $cj = HTTP::Cookies->new;
> 
> $cj->set_cookie(
>     1,                     # version
>     'username',            # key
>     'joe',                 # value
>     '',                    # path
>     'tparsons.co.uk',      # domain
>     '80',                  # port
>     '/blah',                     # path_spec
>     0,                     # secure
>     3600,                  # maxage
>     0,                     # discard
> );
> print $cj->as_string, "\n";
> {use Data::Dumper; local $Data::Dumper::Sortkeys=1;
>     print Dumper( $cj)}
> 
> 
> Why does the cookie not set?  And why does ->set_cookie() never return
> anything to show failure?  And why does ->set_cookie() never get
> exercised in the test suite?
[snip]
Looks like the problem is the '' empty string for the path element.

When I put in: '/this_is_a_test' instead,  it works as expected.


-- 
In Reach Technology:    http://www.inreachtech.net/

Robert G. Werner
[email protected]

Tel: 559.304.5122

It's all right letting yourself go as long as you can let yourself back.
		-- Mick Jagger
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.