[PHP] session_start() [function.session-start]: Cannot send session cache limiter

http://kalserverace.com
Joined
Sep 12, 2006
Messages
477
Reaction score
17
PHP:
Warning:  session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Documents and Settings\All Users\Documents\website\Server_Ace\members\index.php:1) in C:\Documents and Settings\All Users\Documents\website\Server_Ace\members\index.php on line 2

PHP:
        <?php
        session_start();  <<Line 2
  if ($_SESSION["ks_logged"] != "s")
  {
            include("log.php");
            }
    else {
       if ($_SESSION["ks_logged_a"] == "11") {
            
            $name = ($_SESSION["ks_logged_id"]);

any one knows how to fix this?
 
Last edited by a moderator:
session_start must be the first line of ANY page, even if your including it in a different file. Place <?php session_start(); ?> at the very first line of your index.php.
 
make sure that there is NO space of any kind of character before the <? or after the ?> this is the most common reason of this error. :)

Else than that I really don't know.
 
Re: Warning: session_start() [function.session-start]: Cannot send session cache limi

Use: ob_start(); to avoid headers errors or buffors overloading.

NOTE:
This function must be used before session_start();


PS: Guys, before you post something, be sure it will help.
 
Re: Warning: session_start() [function.session-start]: Cannot send session cache limi

Use: ob_start(); to avoid headers errors or buffors overloading.

NOTE:
This function must be used before session_start();


PS: Guys, before you post something, be sure it will help.

Possible, but its not a good solution.

Just use session_start(); before ANY html output is send. This can be the echo function or html (even spaces) before the <?php tag.

make sure that there is NO space of any kind of character before the <? or after the ?> this is the most common reason of this error. :)

Else than that I really don't know.

Aftetr the ?> tag is doesn't care, its a header sending problem, not some footer sending problem :P.
 
Re: Warning: session_start() [function.session-start]: Cannot send session cache limi

It's good solution for powerfull services, if you want to insert two or more headers.

Don't forget that there's something like Header(); and much more functions that can fight with session_start() if you don't enable buffor-managing.

Read more about OB-related functions.
 
Back