Hey Folks, I was having this issue several years ago (about 4-5 now) where one of my systems would get a cookie from the server, and another would not. I tried everything, newer modules, older modules, different perl versions, reinstalling perl altogether; and still couldn't figure it out. It seemed once a system decided that it didn't want the cookie it wasn't going to take it. I had a contact at the server side, and checking the log files he assured me that cookies were being sent for both systems. I turned on LWP debug in verbose and saw that A cookie was recieved, but as soon as I finished the user agent request, and tried to print Dumper($cookie_jar) the jar was empty again. I gave up and ran the code on a system where it worked, and called it from the other system where I needed it. This problem just resurfaced this morning, A system that could get cookies just stopped for no apparent reason. Since this morning was so close to the DST switch, we finally suspected that it might be related to the expiration data of the cookie. It turns out that the cookies.pm module was getting the cookie, but then discarding it based on a bad timestamp on one of the systems (server or client) and the differences in DST settings. Disabling the $expires checking in the cookies.pm module allowed the saving of, and returning of the cookie. That's not the fix obviously, as it's ugly beyond compare. But I do notice that the module make some use of the $EPOCH_OFFSET environment variable and also has provisions for MacOS's different EPOCH date. Perhaps, any reference to the epoch might best be left for things far more permanent than web cookies. -Dan.

In reply to Re^5: Missing cookies with LWP::UserAgent and HTTP::Cookies by dataDrone
in thread Missing cookies with LWP::UserAgent and HTTP::Cookies by neilwatson

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.