This is in answer to the replies by Corion and Anonymous.
In many sites I can see multiple cookies, and this problem only happens at a few sites.
###part of the code picked out of a long module ####
###this code is here to be read, but not run ####
sub call_httpd_exec{ use LWP::UserAgent; use HTTP::Cookies; my $user_agent = LWP::UserAgent->new; ###cookie handling $user_agent->cookie_jar(HTTP::Cookies->new()); $cookie_list = $hash->{cookies}; my $path; my $cookie; my $cookie_url_obj = URI->new($hash->{url}); foreach $cookie (split(/;/,$cookie_list)) { $path=""; my ($key,$value); if ($cookie =~ /=/){ $key = $`; $value = $'; } $user_agent->cookie_jar->set_cookie(0,$key,$value,"/$path" +,$cookie_url_obj->host); } $reqObj = new HTTP::Request($method,$urlObj,$hdrObj,$cgi_param); $resObj = $user_agent->request($reqObj); my $cookies_new = $user_agent->cookie_jar->as_string; }
### part of $reqObj containing 'cookie' (taken from debugging)
'_headers' => HTTP::Headers=HASH(0xa313f2c) 'accept' => 'application/pdf, image/gif, image/x-xbitmap, ima +ge/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd. +ms-excel, application/msword, */*' 'accept-language' => 'en-us' 'cache-control' => 'no-cache' 'connection' => 'Keep-Alive' 'cookie' => 'Safari=cookieversion=2&portal=proquest&key=28C4E +E2EC2EFBDF1267FF592AAD06A5BAE28C372EF649FA2330F854B8672810B0063D8E5A8 +E98CB62C04AE2C7B9BA3CF148D6991A177D401FB48505D6F8A7A89C89BA42D8CF6F79 +7869A9946885022A0F3066521D43FAC3E1AAFCA769B525590&sessionid=5b172b6b- +092a-48a4-8b84-81ee5f1892e6&ref=Undefined&oref=%2f' 'cookie2' => '$Version="1"' 'soapaction' => ' ' 'user-agent' => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows +NT 5.0)' '_method' => 'GET' '_protocol' => undef
### the cookie as it appears in firefox
Cookie: s_cc=true; s_sq=%5B%5BB%5D%5D; Safari=cookieversion=2&portal=p +roquestcombo&key=64557762631998E5DD4D23ABF32D1C0FCEAA96D75669DF33AEFC +D5004C989B6082ACAEDCFD96951AE809EBAFFDFBED8048F28F2E9B20EC2F22865FC07 +FAD7F31B7916ECFF69E6EBB6AA5C07F7C74E346A506E0F1C58BD71AB7ECEE419D1739 +E4EA308D&sessionid=f2281fc8-facd-4ea6-ab1e-68daacfcbceb&ref=Undefined +&logged=true&oref=%2f; State=aph=PZURKFXQXnYHVSNRRMPjVILBBZANIEHFVCNf +oZGYRXVVCLASVDKBWKHATBMV&rememberpassword=&uicode=proquest&PromoCode= +&itemsperpage=20&portal=proquestcombo

In reply to Re^2: multiple cookies in LWP HTTP:Cookies by RinaR
in thread multiple cookies in LWP HTTP:Cookies by RinaR

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.