0

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent on line 2

I searched on every questions. I see the solve putting this on the top of the page.

I did:

<?php session_start();?>

got the same error. Can someone help?

gen_Eric
  • 223,194
  • 41
  • 299
  • 337

2 Answers2

2

Cannot send session cache limiter - headers already sent

Always means that you have printed some content before. Check if there is no HTML code or any other echo`ed text.

hsz
  • 148,279
  • 62
  • 259
  • 315
1

You should be generous to yourself and provide the information where the output started:

<?php    

if (headers_sent($filename, $linenum)) {
    trigger_error("Headers already sent in $filename on line $linenum", E_USER_ERROR);
} 

session_start();

?>

That should give you more information to easier troubleshoot the problem.

And the best book on Stackoverflow for that error message is:

Community
  • 1
  • 1
M8R-1jmw5r
  • 4,896
  • 2
  • 18
  • 26