Subject: | a possible bug in HTTP::Cookies::Microsoft? |
I use $VERSION = "5.810" of Cookies::Microsoft in ActivePerl 5.8, but
find sometimes the cookie added to request is not complete:
for example, when the target is books.google.cn, only books.google.cn
cookie is added, but not google.cn.
I tracked down to a line reading cookie files from index.dat, which
is in sub load():
if ($data =~ /Cookie\:$user_name\@([\x21-\xFF]+).*?
($user_name\@[\x21-\xFF]+\.txt)/)
my user name is "shaohua li", but the browser stores google.cn's
cookie in "shaohua_li@google[5].txt", as filemon reveals.
So here is a mismatch and this entry is skipped.
I'd like to patch this line as:
my $user_name2 = $user_name; $user_name2 =~ s/ /_/g;
if ($data =~
/Cookie\:$user_name\@([\x21-\xFF]+).*?((:?$user_name|$user_name2)\@
[\x21-\xFF]+\.txt)/)
I guess this might cover all situations.