session_start(): Cannot send session cache limiter - headers already sent

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence k

    session_start(): Cannot send session cache limiter - headers already sent


    I'm getting this warning:

    [15-May-2006 18:11:35] PHP Warning: session_start() : Cannot send
    session cache limiter - headers already sent in
    /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSes sion.php
    on line 14


    line 14 is this:

    session_start() ;


    why is that creating a warning?

  • Rik

    #2
    Re: session_start() : Cannot send session cache limiter - headers already sent

    lawrence k wrote:[color=blue]
    > I'm getting this warning:
    >
    > [15-May-2006 18:11:35] PHP Warning: session_start() : Cannot send
    > session cache limiter - headers already sent in
    >[/color]
    /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandS
    tartSession.php[color=blue]
    > on line 14[/color]


    Note: If you are using cookie-based sessions, you must call session_start()
    before anything is outputted to the browser.

    Comment of header() is also applicable:

    Remember that header() must be called before any actual output is sent,
    either by normal HTML tags, blank lines in a file, or from PHP. It is a very
    common error to read code with include(), or require(), functions, or
    another file access function, and have spaces or empty lines that are output
    before header() is called. The same problem exists when using a single
    PHP/HTML file.

    Grtz,
    --
    Rik Wasmus


    Comment

    • lawrence k

      #3
      Re: session_start() : Cannot send session cache limiter - headers already sent


      Rik wrote:[color=blue]
      > lawrence k wrote:[color=green]
      > > I'm getting this warning:
      > >
      > > [15-May-2006 18:11:35] PHP Warning: session_start() : Cannot send
      > > session cache limiter - headers already sent in
      > >[/color]
      > /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandS
      > tartSession.php[color=green]
      > > on line 14[/color]
      >
      > http://nl2.php.net/manual/en/function.session-start.php
      > Note: If you are using cookie-based sessions, you must call session_start()
      > before anything is outputted to the browser.[/color]

      Yes, I know, but the error is pointing to a line that says only this:

      session_start() ;

      Is that not insane?

      It's saying that headers were already sent in CommandStartSes sion.php
      on line 14, but line 14 simply calls session_start() .

      I mean, what the hell?

      Comment

      • Rik

        #4
        Re: session_start() : Cannot send session cache limiter - headers already sent

        lawrence k wrote:[color=blue]
        > Yes, I know, but the error is pointing to a line that says only this:
        >
        > session_start() ;
        >
        > Is that not insane?
        >
        > It's saying that headers were already sent in CommandStartSes sion.php
        > on line 14, but line 14 simply calls session_start() .[/color]

        Lines in error reporting aren't always correct, sometimes you have to do it
        the hard way.

        Grtz,

        --
        Rik Wasmus


        Comment

        Working...