|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
45 - 21 = ?
Subscribe to this entry?

 [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: Sun Jul 21 00:01:30 2024 UTC