PHP: unable to send cookie cookie

I am trying to set up a session and I get a header error, let me know as far as I can tell, I tell him to start a session before sending the header. any help here would be helpful.

<?php ob_start(); session_start(); $_SESSION['active'] = 1; ob_end_flush(); ?> <html> <body> 2009c Christ Redeemer Catholic Church </body> </html> 

Warning: session_start () [function.session-start]: Unable to send session cookie - headers already sent (output started in / home / content / k / u / r / kuriomister / html / temp / church / index. Php: 1) in /home/content/k/u/r/kuriomister/html/temp/church/index.php on line 3

Warning: session_start () [function.session-start]: Unable to send session cache limiter - headers already sent (the output is started in / home / content / k / u / r / kuriomister / html / temp / church / index. Php: 1) in /home/content/k/u/r/kuriomister/html/temp/church/index.php on line 3

+4
source share
2 answers

If you use UTF-8, be sure to save the file without a specification .

+9
source

See output: Cannot send session cookie - headers already sent by (output started at /home/content/k/u/r/kuriomister/html/temp/church/index.php:1) . It seems you have spaces (spaces, tabs, lines, ...) at the beginning of the file.

+3
source

All Articles