Warning: session_start(): Cannot send session cookie - headers already sent by …
It took me a while to fix this problem. Nothing I did seemed to help. I put the session_start() statement at the beginning of the file, removed the whitespace before the session_start(). I still got the same error: Warning: session_start(): Cannot send session cookie - headers already sent by…
Then I had another look at my code. It turned out the the opening php tag started on the second line, and the first line was empty. Once I had removed the blank line, the error disappeared!
Also, if you have include files there should not be any blank lines after the closing php tag. This will cause the headers already sent error as well.
I have to thank the replies posted at the experts-exchange website that prompted me to see this error.
