Bug #8974 Updated: Blank lines in includes cause session errors

From: Date: Sun, 06 Jan 2002 18:03:47 +0000
Subject: Bug #8974 Updated: Blank lines in includes cause session errors
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76072@lists.php.net to get a copy of this message
ID: 8974 Updated by: jan Reported By: samj@faredge.com.au Old Status: Open Status: Bogus Bug Type: Feature/Change Request Operating System: All PHP Version: 4.0.4pl1 New Comment: technically it is an user error. to solve it either eliminate any whitespace or call ob_start() before session_start(). the same thing applies for header(). no bug. bogus Previous Comments: ------------------------------------------------------------------------ [2001-01-29 00:42:42] samj@faredge.com.au A PHP script with includes followed by commands which set headers (ie session_start) will generate errors if include file(s) contain blank lines. For example: <? include "includes/functions.inc"; session_start(); ?> where functions.inc contains leading or trailing blank lines will result in an error like: Warning: Cannot send session cache limiter - headers already sent This problem appears to be very common (according to a search on google), and has no doubt frustrated many PHP users. Unfortunately this behaviour is technically 'correct', although it should probably be fixed anyway. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=8974&edit=1

« previous php.dev (#76072) next »