PHP: Can not send a session cookie error

advertisements

This question already has an answer here:

  • How to fix “Headers already sent” error in PHP 11 answers

Im trying to set up a session and i am getting a header error, dispite as far as i can tell i am telling it to start the session before the header is sent. any help here would be useful.

<?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]: Cannot send session cookie - headers already sent by (output started at /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]: Cannot send session cache limiter - headers already sent (output started at /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


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