Set cookies issue

Hi!

I am experiencing cookie corruption.

Setting cokkies as following:


$cookieName = '_my_cookie';

$cookieValue = 'b1a6a692421175ae.1412089317.0.0.0.0';


$cookie = new CHttpCookie($cookieName, $cookieValue);


Yii::app()->request->cookies[$cookieName] = $cookie;

But in response header I got:

_my_cookie=f62715c8e0b4293790384b9544c9c310ce389b08s%3A35%3A%22b1a6a692421175ae.1412089317.0.0.0.0%22%3B; expires=Thu, 29-Sep-2016 15:01:57 GMT; path=/;

What may be a reason for cookie corruption?

I don’t understand how your code works)) I think you should be get exception.

Cookie must be set like this:




Yii::app()->request->cookies[$cookieName] = new CHttpCookie($cookieName, $cookieValue);



Detailed description see: http://www.yiiframework.com/wiki/152/cookie-management-in-yii#hh2

Thanks the code was exactly as you mentioned.