Bug 67853 - cookie problem with php 4.2.1 and httpd 2.0.36
Summary: cookie problem with php 4.2.1 and httpd 2.0.36
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: php
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Copeland
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-07-03 06:59 UTC by Todd Mokros
Modified: 2007-04-18 16:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-05 18:18:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Todd Mokros 2002-07-03 06:59:21 UTC
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.)

Comment 1 Phil Copeland 2002-08-05 18:18:15 UTC
You don't happen to have the one liner to hand do you? 8)

Phil
=--=

Comment 2 Phil Copeland 2002-08-07 23:40:50 UTC
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
=--=


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