Subject: | bug report |
Date: | Mon, 12 Mar 2012 10:19:23 -0400 |
To: | bug-HTTP-Cookies [...] rt.cpan.org |
From: | Jan Hulala <jan.hulala [...] gmail.com> |
In add_cookie_header $val should be checked as described below >>
sub add_cookie_header
{
...
while (($key,$array) = each %{$cookies->{$path}}) {
my($version,$val,$port,$path_spec,$secure,$expires) =
@$array;
# *this line has to be added, to prevent errors for
undefined value*
next if !defined($val);
if ($secure && !$secure_request) {
next;
}
...
}
----
The above recommendation is based on experience when application using
WWW::Scripter module
parsed a web page containing the following JavaScript:
if (typeof navigator.cookieEnabled == "undefined") {
document.cookie = "cookie";
test = (document.cookie.indexOf("cookie") != -1) ? true :
false;
}
Once the fix recommended above has been applied, no error occurred.