Yii 1.0 操作 Cookies
Code Here. ^&^
{Create}
$cookie = new CHttpCookie('mycookie','cookies from YiiLib.com'); $cookie->expire = time()+60*60*24*30; //30 天 Yii::app()->request->cookies['yiilib']=$cookie;
{Read}
$cookie = Yii::app()->request->getCookies(); echo $cookie['yiilib']->value; //cookies from YiiLib.com
{Destory}
$cookie = Yii::app()->request->getCookies(); unset($cookie['yiilib']);
非常容易实现有没有? ^&^
wiki link http://www.yiiframework.com/wiki/152/cookie-management-in-yii/
留言
Starleigh
2015-03-14 15:10:52I was really confused, and this answered all my qusstione.