Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Posts
    262
    Thanks
    1
    Thanked 0 Times in 0 Posts

    What does this warning mean?

    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_start();
    $_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?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Jul 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •