Is It A Bug For Chttprequest?

HI,guys:

I use cookie.jquery.js setup a cookie:


$.cookie('result', my, {'domain': 'common.xxx.com.cn', 'path': '/'});

when I get value by $_COOKIE[‘result’],but I can not get the key and the value of it.why? Is it a bug for CHttpRequest?


$cookies = $r->getCookies()->getIterator();

$cookies2 = $_COOKIE['result'];

$r = Yii::app()->request;

$r->getCookies()->getKeys();

while ($cookies->valid()){

	CVarDumper::dump($cookies->current()->name);

	$cookies->next();

}

do you have cookie validation turned on (http://www.yiiframework.com/doc/guide/1.1/en/topics.security#cookie-attack-prevention)?

if so - maybe your cookie does not pass validation process…

yes,I turn on cookie validation.

so - this is the answer. Cookies created by Yii with cookie validation turned on have some control sum that validates if they were not altered (or maybe it is done different way I am not sure about specific implementation). Your cookie has just plain value so it does not pass the validation process. If you want to use such cookies in Yii way - you have to turn of cookie validation…