|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8974 Blank lines in includes cause session errors
Submitted: 2001-01-29 00:42 UTC Modified: 2002-01-06 13:03 UTC
From: samj at faredge dot com dot au Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: samj at faredge dot com dot au
New email:
PHP Version: OS:


 [2001-01-29 00:42 UTC] samj at faredge dot com dot 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/";

where 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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-06 13:03 UTC]
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
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 15:01:28 2024 UTC