Warning regarding sesion_start [duplicate]
Possible Duplicate:
php headers already sent error
I've this warning. How can I开发者_如何学Python fix it?
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\PhpProject1\login.php:2) in C:\AppServ\www\PhpProject1\controller\login.controller.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\PhpProject1\login.php:2) in C:\AppServ\www\PhpProject1\controller\login.controller.php on line 2
paste session_start(); in the first line
You should also be aware that saving your files in the wrong encoding can produce this error.
http://forums.iis.net/t/1171412.aspx
Session needs to be started before ANY content is printed out. You're echoing something earlier or simply printing something outside PHP tags.
Move your session_start before those print outs. This concerns print outs from ALL your files. It says you even where you've printed stuff out.
output started at C:\AppServ\www\PhpProject1\login.php:2
精彩评论