PHP warning

Cannot modify header information - headers already sent by (output started at /web/paintballshop/paintballshop.hu/protected/controllers/NewsController.php:17)

/web/paintballshop/paintballshop.hu/framework/web/CHttpRequest.php(1380)

1368     }
1369 
1370     /**
1371      * Sends a cookie.
1372      * @param CHttpCookie $cookie cookie to be sent
1373      */
1374     protected function addCookie($cookie)
1375     {
1376         $value=$cookie->value;
1377         if($this->_request->enableCookieValidation)
1378             $value=Yii::app()->getSecurityManager()->hashData(serialize($value));
1379         if(version_compare(PHP_VERSION,'5.2.0','>='))
1380             setcookie($cookie->name,$value,$cookie->expire,$cookie->path,$cookie->domain,$cookie->secure,$cookie->httpOnly);
1381         else
1382             setcookie($cookie->name,$value,$cookie->expire,$cookie->path,$cookie->domain,$cookie->secure);
1383     }
1384 
1385     /**
1386      * Deletes a cookie.
1387      * @param CHttpCookie $cookie cookie to be deleted
1388      */
1389     protected function removeCookie($cookie)
1390     {
1391         if(version_compare(PHP_VERSION,'5.2.0','>='))
1392             setcookie($cookie->name,'',0,$cookie->path,$cookie->domain,$cookie->secure,$cookie->httpOnly);

Stack Trace

#3
+
 /web/paintballshop/paintballshop.hu/protected/components/Functions.php(19): CMap->offsetSet("customer_id", CHttpCookie)
14 
15     public static function setCookie($cookie_name, $cookie_value, $time = 30) {
16 
17         $cookie = new CHttpCookie($cookie_name, $cookie_value);
18         $cookie->expire = time() + 60 * 60 * 24 * $time;
19         Yii::app()->request->cookies[$cookie_name] = $cookie;
20         return true;
21     }
22 
23     public static function setCookieforCustomer() {
24         if (!isset(Yii::app()->request->cookies['customer_id'])) {
#4
+
 /web/paintballshop/paintballshop.hu/protected/components/Functions.php(26): Functions::setCookie("customer_id", "z3gHxODMGV")
21     }
22 
23     public static function setCookieforCustomer() {
24         if (!isset(Yii::app()->request->cookies['customer_id'])) {
25             $customer_id = self::generateRandomString();
26             self::setCookie('customer_id', $customer_id);
27         }
28     }
29 
30     public static function getCustomerId() {
31 
#5
+
 /web/paintballshop/paintballshop.hu/protected/views/layouts/main.php(2): Functions::setCookieforCustomer()
1 <?php
2 Functions::setCookieforCustomer();
3 $webshop_id = Variables::getWebshop_id();
4 $menu_list = Content::model()->getMenuByPosition(1);
5 
6 $criteria = new cdbCriteria;
7 $criteria->condition = "category_level = 0 AND log_del != 1 AND active = 1 AND webshop_id = {$webshop_id}";
2017-08-17 21:11:14 Apache Yii Framework/1.1.14