-2

one of my php file has include in many different pages. some pages already have session_start, some are not.

therefor i have a add if(!isset($_SESSION)){session_start();}

to check if if session start already been set,

if the session start is not set, it will put into the code

It works fine in my local machine, but when i upload it, i got error

Cannot send session cache limiter - headers already sent (output started at...

anyone know where is the problems?

Ben
  • 2,562
  • 8
  • 37
  • 62

1 Answers1

0

It means that some output has been send by the page. Make sure nothing (Not even a single space) is output by the page before working on the headers.

It basically is sloppy programming. If you do not know whether a session has been set, you also do not know whether output has been created.

Jelle Ferwerda
  • 1,254
  • 1
  • 7
  • 13