View Full Version : What does this warning mean?

10-08-2003, 04:53 AM
Warning: Cannot send session cache limiter - headers already sent (output started at c:\blah\client-info.php:11) in getInvoices.php on line 3

I'm getting this where I call session_start();

I'm just learning about sessions, so I may have done something wrong. I'm starting my session at the login script something like:

$_SESSION['client'] = $_POST["client"];
$_SESSION['admin'] = 1;
$_SESSION['user'] = 0;
header("Location: /client-center-panel.php");

one of the links on the page they log into (assuming log in was successful) takes them to an invoice page, which has an included script to display some invoices in a table on that page. I'm calling session_start first thing in the invoice script and this is where the warning is shown, the script does run and display invoices though.

Any thoughts?

10-08-2003, 05:31 AM
That error means you cannot send anything to the browser before you start the session. That means no echo statements, no spaces before the <?php tag.

10-10-2003, 12:47 PM
Lot of people get confused by that error.
If you are sure you are not outputting anything to browser before calling session_start(),check for any carriage returns in the file which might be added by your editor.If found remove them.