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

 



[b]

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?




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



how can i do this? can anyone help me…

Thanks in advance

read this article:

http://www.yiiframework.com/forum/index.php/topic/15820-handling-cookies/

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

Hi,

This may help you!

array values in cookies

Cheers!

[b]

[/b]

[b]

[/b]

If you like don’t forget to press +