2012-09-05 15:39:27  浏览:1509

cakephp cookie

Cakephp已经提供Cookie Component,我们可以直接调用方法。

方法有:

write:写入cookie

read:读取cookie中的内容

delete:删除cookie

destroy:销毁所有cookie

使用方法:

先引入cookie库

var $components = array (
'Cookie' => array (
"time" => "2 Days" 
));

写入cookie:$this->Cookie->write ("login_cookie",array("name"=>"name","password"=>"password"));
读取cookie:$cookie = $this->Cookie->read ("login_cookie");

删除cookie:$this->Cookie->delete("login_cookie");



返回首页