Bug #2968: white space in document before setcookie() is called ruins chance to setcookie

From: Date: Mon, 13 Dec 1999 19:19:55 +0000
Subject: Bug #2968: white space in document before setcookie() is called ruins chance to setcookie
Groups: php.dev 
Request: Send a blank email to php-dev+get-13620@lists.php.net to get a copy of this message
From: sladd@mail.rit.edu Operating system: Linux 2.2.13 PHP version: 3.0.12 PHP Bug Type: Parser error Bug description: white space in document before setcookie() is called ruins chance to setcookie I don't think this is the way it is supposed to be. If there is white space before a setcookie() call, even if no text is sent, setcookie fails because it was thinking that text has been sent. More exactly, if we have this (the dashes indicate begining of file) ---------------------------------------- <?php include("include.inc"); ?> <?php setcookie("test", "test", time()+60); ?> ----------------------------------------- will FAIL, even though inside my include.inc I have no text being printed out. The following DOES work. -------------------------------------- <?php include("include.inc"); ?> <?php setcookie("test", "test", time()+60); ?> ------------------------------------- Notice how there is no space after the include. The whitespace outside of the <?php ?> tags seems to matter. This is not clearly defined in the documentation, and I believe it's a bug.

« previous php.dev (#13620) next »