Listed under PHP Sessions
Below are some of the common problems faced by beginners while using sessions in PHP.
This is the most commonly faced error is also the easiest to fix. Lets first see what a typical HTTP response looks like.

As can see from the image headers always precede (come before) the content. The “headers already sent” error occurs when you call session_start after you have already sent some content to the browser. Event an empty line at the start of the file is considered as content and will cause error.

How to fix
<?php //Start bufferng the output ob_start(); print("Some text"); //Since the output is now buffered, //the above statement will not cause any error session_start(); ?>
It is possible that session_start might get called multiple times by way of include files. This will not break you script but it might, depending on your error reporting settings, display a notice on your browser.
Multiple calls to session_start will result in an error of level E_NOTICE. Only the first call to session_start will be effective and all subsequent calls will be ignored.
Comments
Very useful. I had so many includes in my script. I had to go through each file to find those blank lines, that plus adding ob_start() proved to be very useful. Thanks :)