From: bugreport%peshkin.net <> Date: Sat, 31 Aug 2002 08:53:12 +0000 (+0000) Subject: Bug 121419 - If multiple cookies exist, the least significant is assigned. X-Git-Tag: bugzilla-2.17.1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ac32582430a259ef71ea21d68affcd55aad31e8;p=thirdparty%2Fbugzilla.git Bug 121419 - If multiple cookies exist, the least significant is assigned. 2xr = bbaetz Also fixes Duplicate Bug 165685 When switching from no cookiepath to using cookiepath, old cookie gets in the way --- diff --git a/CGI.pl b/CGI.pl index 8f412665ea..a0a0cfd72d 100644 --- a/CGI.pl +++ b/CGI.pl @@ -1064,7 +1064,9 @@ if (defined $ENV{"HTTP_COOKIE"}) { foreach my $pair (split(/;/, $ENV{"HTTP_COOKIE"})) { $pair = trim($pair); if ($pair =~ /^([^=]*)=(.*)$/) { - $::COOKIE{$1} = $2; + if (!exists($::COOKIE{$1})) { + $::COOKIE{$1} = $2; + } } else { $::COOKIE{$pair} = ""; }