Friday, November 02, 2007

session_start() caveats in php coding

The new schedule page admin interface had a bug of having to login twice - and momentarily some error messages would appear.
session_start(): Cannot send session cookie - headers already sent 
Reason was the session_start() function being called in the body of the page. It should appear before any output is sent to the browser, as mentioned below:

http://in.php.net/session_start

http://www.koderguru.com/tutorials/phptutorials/headertuto1.php

No comments:

Post a Comment