From 5ac32582430a259ef71ea21d68affcd55aad31e8 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sat, 31 Aug 2002 08:53:12 +0000 Subject: 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 --- CGI.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index 8f412665e..a0a0cfd72 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} = ""; } -- cgit v1.2.3-24-g4f1b