Bug 67853 - cookie problem with php 4.2.1 and httpd 2.0.36
cookie problem with php 4.2.1 and httpd 2.0.36
Product: Red Hat Raw Hide
Classification: Retired
Component: php (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Copeland
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2002-07-03 02:59 EDT by Todd Mokros
Modified: 2007-04-18 12:43 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-05 14:18:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Todd Mokros 2002-07-03 02:59:21 EDT
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

Version-Release number of selected component (if applicable):

How reproducible:

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:


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.)
Comment 1 Phil Copeland 2002-08-05 14:18:15 EDT
You don't happen to have the one liner to hand do you? 8)

Comment 2 Phil Copeland 2002-08-07 19:40:50 EDT
Ok,.. looking through the reports it is indeed a one liner (checked)

-       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


Note You need to log in before you can comment on or make changes to this bug.