How To Update Cookie Value

i am using cookie first time in Yii… i am referring This wiki link. now i am able to create cookie and now i stuck in "How to update cookie value"?

in my case…

 Yii::app()->request->cookies['username']=new CHttpCookie('username',''); // my created cookie



how can define cookie value as array?[/b]

 Yii::app()->request->cookies['username']=new CHttpCookie('username',array()); 


now i want to update my cookie with updated array…

$username = array_push(Yii::app()->request->cookies['username'], Yii::app()->user->username);

is it possible to update cookie array() like this?


how can i do this? can anyone help me…

Thanks in advance

read this article:

which i am refereeing article that includes your mentioned article here…


This may help you!

array values in cookies






If you like don’t forget to press +