Warning: session_start(): Cannot send session cookie headers already sent
Some times when you intergrate your existing wordpress blog with an external website or at times when you go for something like
<?php
require_once('body.php');
?>
2.php
<?php in your webpage, you will be getting a warning stating that
session_start();
?>
Warning: session_start(): Cannot send session cookie headers already sent
To eliminate this warning it is pretty simple just add this code
<?php
ob_start();
<!–YOUR INCLUDE SCRIPT HERE–>
ob_end_clean();
?>
Thats all, issue is fixed have a nice day.
Related posts:
- Include files in php using include, include_once, require or require_once
- “Header already sent” in php error and other use of Header function in PHP
