Hi all,

below you find a patch to HTTP::Cookies::Netscape::load() that allows 
the module to accept cookie files made by Mozilla, not only Netscape.

Why: In most systems, Netscape version 4 and below are phased out or not 
installed anymore. Instead, people use Netscape version 6/7 or Mozilla. 
It is therefore important to update Perl's cookie file handling code to 
understand and correctly process Mozilla cookie files.

I found this bug in an open-source perl application I maintain that 
requires cookie support. Because of the bug, I have to distribute my own 
version of Cookies.pm.

Any reason this should not be included in the standard distribution?

Cheers

Hans

--- Cookies.pm.old      2002-11-13 10:02:51.000000000 -0700
+++ Cookies.pm  2002-11-13 09:53:59.000000000 -0700
@@ -742,7 +742,7 @@
     my @cookies;
     open(FILE, $file) || return;
     my $magic = <FILE>;
-    unless ($magic =~ /^\# Netscape HTTP Cookie File/) {
+    unless ($magic =~ /^\# (?:Netscape )?HTTP Cookie File/) {
        warn "$file does not look like a netscape cookies file" if $^W;
        close(FILE);
        return;



-- 
Hans Ecke                   hans<at>ecke.ws / hans<at>acoustics.mines.edu
Department of Geophysics    http://hans.ecke.ws
Colorado School of Mines    Tel: (USA) 303-273-3733
Golden, Colorado            Fax: (USA) 303-273-3478

All opinions expressed herein are solely those of my friend,
Buck the squirrel.

Reply via email to