Hi Adam.
I use start event for some reason and cookies seem to be sent properly.
Doesn't your problem have something to do with redirection?
I just found that Mojo::UserAgent doesn't set User-Agent header for redirected requests.
I don't know this is bug or not but the request may causes the server side app
to close the session for security reason.
I'm testing with CakePHP for server side.
When $ua->max_redirects(5),
POST /login (with User-Agent header)
-> redirected to /index with Set-Cookie for PHPSESSID
GET /index (with Cookie header but no User-Agent header)
-> session deleted by CakePHP
To prevent this, I set the user_agent manually for now.
$ua->on(start => sub {
my ($ua, $tx) = @_;
$tx->req->headers->user_agent('My Agent');
});