-5

I dont know why I'm having this error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/jogarspy/public_html/index.php:2) in /home/jogarspy/public_html/core/init.php on line 3

In my init.php there are just one session_start();

How can I fix it?

nickb
  • 59,313
  • 13
  • 108
  • 143
user2628118
  • 13
  • 1
  • 4

2 Answers2

2

Starting a session sends a cookie to the browser. This is in the HTTP header. Therefore do it before sending any other output as this will tell the web server the headers are good to go.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127
1

session_start() needs to be on the very first line of the file.

Look at "Starting a PHP Session"

http://www.w3schools.com/php/php_sessions.asp

Mattigins
  • 1,014
  • 9
  • 25