This is interesting. I tested with several URLs and yes, it appears that the server did not send a cookie. However, if I visit the same URL with Firefox I receive a cookie. Does this mean that there is a server side mechanism that may not send cookies to all agents?
| [reply] [Watch: Dir/Any] |
Thats not uncommon. You can fake your useragent with $ua->agent('blabla'); or with my $ua = LWP::UserAgent->new( keep_alive => '1', agent => 'Mozilla/5.0');
. Try it.
| [reply] [Watch: Dir/Any] |
Tried that. Still no dice.
| [reply] [Watch: Dir/Any] |
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.
| [reply] [Watch: Dir/Any] |