I keep getting "headers already sent" whilst trying to use sessions |
|
"Warning: Cannot send session cookie - headers already sent by (output started at c:\wwwroot\somesite\cart.php3:9) in c:\wwwroot\somesite\cart.php3 on line 11
Check through your code prior to the session_start(); command.
You will
have sent some text to the browser, and since headers (and
cookies which are contained within headers) need to be sent before any
output, this causes the error.
Look for any print, printf, or echo commands. Also look for
whitespaces, tabs etc. before the session_start();
Look for include('file') statements, they might be causing the
problem.
|