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

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

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

header("set-cookie: test1=1");
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


Support for DragonflyCMS in a other languages: