Sunday, July 4, 2010

PHP Trouble-Shooting and Self References

Session Warning

Problem: Start getting session warning today - "Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/dbconnect.php:10) ..."

Solution: To fix this issue, I had to move "session_start();" to the begining of the page. Then it all started working fine. This was not an issue before. I read from some posts that if you are using cookie based session, you need to call this statement before anything else. Anyway, log this for future reference, in case I forget about it, as I always do. ;)

No comments:

Post a Comment