#18337 [Opn]: General cookies have higher priority than specific
| From: | shaggy at vip dot bg | Date: | Thu, 08 Aug 2002 23:10:27 +0000 |
| Subject: | #18337 [Opn]: General cookies have higher priority than specific | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16335@lists.php.net to get a copy of this message | ||
ID: 18337
User updated by: shaggy@vip.bg
Reported By: shaggy@vip.bg
Status: Open
Bug Type: HTTP related
-Operating System: Slackware Linux 8.1, gcc 2.95.3
+Operating System: All
-PHP Version: 4.2.1
+PHP Version: 4.2
New Comment:
You're quiete right, the problem is I don't know how one can store this
information in the _COOKIE array without breaking old apps.
The Netscape docs actually are superceded by an RFC, anyway it says
that if there's more than one cookie the most specific should be taken
into account - if the app can't deal with them all.
Previous Comments:
------------------------------------------------------------------------
[2002-08-08 06:54:08] jait@ee.oulu.fi
Correct me if I'm wrong but according to
http://wp.netscape.com/newsref/std/cookie_spec.html
it seems that there can be multiple cookie definitions with the same
name. And as long as the path is different NONE of them should get
overrided.
And if BOTH name and path equal the most recent cookie should be the
only one that's valid.
So don't you think the correct behaviour is to pass ALL the cookies to
the script as long as the path is different?
But this is kinda difficult with the way the $_COOKIE array is
currently implemented.
jt
------------------------------------------------------------------------
[2002-08-06 14:05:27] blackdragon3001@hotmail.com
I have win XP and PHP 4.2.2!
I have the same problem!
I have see this :http://files.derickrethans.nl/cookie_patch.diff
but can I use this and how?
------------------------------------------------------------------------
[2002-07-14 11:26:09] derick@php.net
Partly fix can be found here:
http://files.derickrethans.nl/cookie_patch.diff
As I have no more time to finish it I just share it here, it works, but
not for registered globals.
Derick
------------------------------------------------------------------------
[2002-07-14 09:28:10] derick@php.net
Working on it...
Derick
------------------------------------------------------------------------
[2002-07-14 09:09:55] shaggy@vip.bg
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 this bug report at http://bugs.php.net/?id=18337&edit=1