From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020606 Description of problem: Only the last cookie set by a php script gets set. If you use a header() function after using setcookie(), no cookies will be sent. A confirmed php4/apache2 bug. According to the php bug list, the bug is currently fixed only on the php CVS HEAD, and it looks like an apache 2.0.40 snapshot is also required. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. create a php page containing multiple setcookie() calls. 2. view the page in a web browser 3. check the list of cookies in the web browser Actual Results: only the last setcookie() call has a cookie set in the browser. Expected Results: all cookies set with setcookie() should be set in the browser. Additional info: The following bug reports deal with this issue: http://bugs.php.net/bug.php?id=17663 http://bugs.php.net/bug.php?id=16626 It looks like this bug may not be resolved in the apache and php stable releases until at least apache 2.0.40 and php 4.3.0 is released. Although I'd imagine that the bugfix may get backported into the 4.2.x series once apache 2.0.40 is released. (It appears to be a one line fix on the php side.)
You don't happen to have the one liner to hand do you? 8) Phil =--=
Ok,.. looking through the reports it is indeed a one liner (checked) php-4.2.2/ext/standard/head.c:125 - return sapi_add_header(cookie, strlen(cookie), 0); + return sapi_add_header_ex(cookie, strlen(cookie), 0, 0 TSRMLS_CC); I've made a patch for the 4.2.2 release in rawhide You should see php-4.2.2-6 (or higher) tomorrow morning on ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS Phil =--=