Bug #18337: General cookies have higher priority than specific

From: Date: Sun, 14 Jul 2002 13:09:57 +0000
Subject: Bug #18337: General cookies have higher priority than specific
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14137@lists.php.net to get a copy of this message
From: shaggy@vip.bg Operating system: Slackware Linux 8.1, gcc 2.95.3 PHP version: 4.2.1 PHP Bug Type: HTTP related Bug description: General cookies have higher priority than specific I use PHP compiled from sources, ./configure --with-pgsql --with-mysql --with-zlib --with-apache=dir Consider the following code has been executed, and another page loaded setcookie('test', 'value1', time()+3600, '/foo/bar/'); setcookie('test', 'value2', time()+3600, '/'); setcookie('test', 'value3', time()+3600, '/foo/'); When a browser requests a file under the /foo/bar/ directory it sends the cookies with the most specific one first: test="value1"; $Path="/foo/bar"; test="value3"; $Path="/foo/"; test="value2"; $Path="/"; Then PHP processes these and it overrides the first two cookies with the most general one which is incorrect. The correct behaviour is to leave the value of the cookie set to the most specific one. -- Edit bug report at http://bugs.php.net/?id=18337&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18337&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18337&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18337&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18337&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18337&r=support Expected behavior: http://bugs.php.net/fix.php?id=18337&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18337&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18337&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18337&r=globals

« previous php.bugs (#14137) next »