Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:52:25+00:00 2026-06-05T22:52:25+00:00

I started using the Mojolicious library for testing and everything was working fine in

  • 0

I started using the Mojolicious library for testing and everything was working fine in until I tried to extract cookies from a response.

I’ve tried several variants of:

$ua = Mojo::UserAgent->new();
$ua->on( error => sub { my ($ua, $error) = @_; say "This looks bad: $error"; } );
$ua->max_redirects(1)->connect_timeout(10)->request_timeout(20);
$ua->cookie_jar(Mojo::CookieJar->new);

# ... later ...

my $tx  = $ua->get($url);
my $jar = $ua->cookie_jar->extract($tx); # This is undef

I can however extract the cookies via LWP::UserAgent. However, LWP has several different issues that make that option unworkable for now. Just for a comparison here is the LWP code that does extract the cookies.

my $lwp = LWP::UserAgent->new(cookie_jar => {}, timeout => 20, max_redirect => 1);
push @{ $lwp->requests_redirectable }, 'POST';
my $response = $lwp->get($url);
die $response->status_line unless $response->is_success;
$lwp->cookie_jar->scan(\&ScanCookies);

sub ScanCookies {
   my ($version, $key, $value) = @_;
   say "$key = $value";
}

So I know that I have the $url etc. correct.

Edit: I should mention that i’m using strawberry 5.14

Edit2: I should also mention that the cookies are getting into the user agent for sure, because the session ID is getting handled properly. Unfortunately, I have a need to access another cookie (for testing the site) and I just don’t seem to be able the get the right incantation to access them… saying that I believe this to be a programmer problem and nothing more.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:52:27+00:00Added an answer on June 5, 2026 at 10:52 pm

    Use this:

    $tx->res->cookies
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started using Zend_Paginator, it works everything fine but I noticed that there is
We started using the kohana project template from synapses studio : https://github.com/synapsestudios/kohana-projecttemplate It's great
We started using Mercurial a several weeks ago. Most developers follow this workflow: work
I started using ZeroMQ this week, and when using the Request-Response pattern I am
I am currently working on a Mojolicious app using TDD on my Mac and
I started using sass scss stylesheets. These generate *.css files from *.scss files. My
We started using Google Maps on our web application rather extensively. It worked fine
I started using the MoveMe sample to get touch input working. basically, I define
I started using NetBeans today, and it was all going swimmingly, until I came
I started using ActiveAdmin recently in a project and almost everything works great but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.