Projects ⇒ Bugs ⇒ #819: Use of flush(); prevents output of further headers. Causes cookie problems. ⇒ CPG Dragonfly™ CMS
Bug #819 Use of flush(); prevents output of further headers. Causes cookie problems.
Project: Dragonfly 9.0 -> 9.0.2 Category: *CPG Core Issues
Submitted: Friday, June 16, 2006 (14:05:43) Modified: Wednesday, June 28, 2006 (22:32:26)
Status: Closed Assigned to:
PHP Version: 4.4 HTTPD Server: Apache 2.0

View/Vote Add Comment

by: pjd@cs.mun.ca
Description:
------------
I'm not a CPG user, but I just spent the past couple hours tracking down this bug for someone and I wanted to make sure that others were aware of it. This is more of a PHP issue, but it requires changes to the design of CPG in order to get around it. On certain platforms, flush(); doesn't allow headers to be sent after it is called. Any headers, such as cookies, that are called after a flush() statement will not be outputted.

During the installation process, for instance, the cookie test will fail because of the flush() call on line 109 of install.php. Commenting out this line allows the installation to proceed, though you might have to delete similar calls throughout the program code.

My platform is:
Linux/i686 2.6.16-gentoo-r7
PHP/4.4.2-pl2-gentoo
Apache/2.0.55
DF_CPG/9.0.6.1

Reproduce code:
---------------
Here's a little snippet to illustrate the issue with PHP

<?php
header("set-cookie: test1=1");
flush();
header("set-cookie: test2=2");
echo "All done.";
?>


Expected result:
----------------
All done.

Actual result:
--------------
Warning: Cannot modify header information - headers already sent in test.php on line 3
All done.
by: NanoCaiordo
Please try using one of these CVS snapshots:

Latest tar.gz
Latest tar.bz2

Bug already fixed on 2005/09/16 19:26:04 (9 months ago)
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español