PHP 4.0 Bug #8382: re-sending http header due to session_start()
| From: | jmessner at neo dot rr dot com | Date: | Fri, 22 Dec 2000 21:38:21 +0000 |
| Subject: | PHP 4.0 Bug #8382: re-sending http header due to session_start() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42151@lists.php.net to get a copy of this message | ||
From: jmessner@neo.rr.com
Operating system: Mandrake 7.1
PHP version: 4.0.2
PHP Bug Type: *Session related
Bug description: re-sending http header due to session_start()
This related to bug #7877, which was said not to be a bug, and that you must session_start() before
any html gets sent so that the cookie gets sent before the html header. Otherwise, calling
session_start() gives the error messages stated in #7877.
At least in 4.0.2, I have found that you cannot even have so much as one blank line in your php file
before your <?php tag, or else the initial header gets sent and start_session() fails. You MUST
have <?php as the absolute very first bytes of your file.
This should either be fixed, or at least well documented. The docs don't say anything about
the importance of start_session() being called immediately, nor do they say anywhere that if you
have any blank lines before your <?php tag that it will then be too late to start a session.
--
Edit Bug report at: http://bugs.php.net/?id=8382&edit=1