I keep getting this error on the pages on my site where I write: session_start();. An example and the error I get are below.
<?php
include("header.php");
// The shopping cart needs sessions, so start one
session_start();
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/c/a/s/cashme/html/buylooper/viewcart.php:5) in /home/content/c/a/s/cashme/html/buylooper/viewcart.php on line 9
How do I solve this?
Put
session_start()before all other lines on very top:Also, don’t
echoorprintor output anything on screen before header is sent.Make sure that you don’t use
session_start()twice for example in your include files otherwise you will receive the same message.More Information on
session_start()