If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[RESOLVED] Cookie problem with Yii framework.

I'm using Yii framework.
I set a cookie as you can see blow , it was working in localhost but stop working after I uploaded my web app on online host. I'm getting this error:
Cannot modify header information - headers already sent by (output started at <path to webapp>/protected/components/Controller.php:1)

Make sure that the /protected/components/Controller.php file does not have anything on line 1 that causes output. One possibility is that you have a BOM (byte order mark) or any other white-space character before the <?php tag. (Make sure your FTP client is not inserting anything, perhaps?)

I use Cpanel to upload web app and I'm sure files are the same and without any change. Even I changed my code with one of Yii's extensions to do this work but I got same error in line of setting cookie again.

output started at <path to webapp>/protected/components/Controller.php:1

This is telling you that something sent output to the client at line 1 of Controller.php. To fix this problem, you either have to figure out what was generating that output and fix it so it no longer does, or else before that file gets invoked, turn on output buffering (either in your php config file, or else via ob_start() in any file -- if there is one -- that gets invoked prior to that file.

YOU WON!
I had changed encoding some of files using Dreamweaver to utf-8. It had added some invisible characters to begin of files. It solved by using ob_start() in Yii config file.
For more information see this: http://www.yiiframework.com/forum/in...rect-problems/

Thank you for your help. Encoding problems make white some of my hairs occasionally!