cakephp的cookie是作为一个插件封装了php的cookie操作。
var $components= array('Cookie');
//设置cookie的基本信息
function beforeFilter() {
$this->Cookie->name = 'baker_id';名字
$this->Cookie->time = 3600; // or '1 hour'过期时间可以是字符
$this->Cookie->path = '/bakers/preferences/'; 保存路径
$this->Cookie->domain = 'example.com'; 域
$this->Cookie->secure = true; //i.e. only sent if using secure HTTPS $this->Cookie->key = 'qSI232qs*&sXOw!';随机密码
}
关于cookie基本的方法:
$this->Cookie->write('user',array('name'=>'swing','rolw'=>'admin'));
可以存储单个或多个值
$this->Cookie->read('user');读取cookie的值
$this->Cookie->delete('user');删除cookie
destory();销毁当前cookie
分享到:
相关推荐
cakephp框架 大家一起分享 一起学习 呵呵
CakePHP是一个基于PHP,免费且开源的迅速发展框架 主要特性: 兼容PHP4和PHP5 数据库交互运用了CRUD(create, read, update and delete),即增查改删。 代码自动产生(代码产生器) MVC体系架构 ...
打包下载,里面有CakePHP的框架源码,下载后可直接使用,版本是1.1的,稳定版;CakePHP的分页组件源码;CakePHP的中文及英文教程,CHM格式;CakePHP的中文打印版教程,WORD格式,下载后可直接打印,方便的;CakePHP...
There are two main ways to get a fresh copy of CakePHP. You can either download an archive copy (zip/tar.gz/tar.bz2) from the main website, or check out the code from the git repository. To download ...
cakephp 框架 cakephp 框架 cakephp 框架 cakephp 框架 cakephp 框架
打包下载,里面有CakePHP的框架源码,下载后可直接使用,版本是1.1的,稳定版;CakePHP的分页组件源码;CakePHP的中文及英文教程,CHM格式;CakePHP的中文打印版教程,WORD格式,下载后可直接打印,方便的;CakePHP...
CakePHP 3.4 开发手册文档 CakePHP Cookbook Documentation Release 3.4
cakephp分页,cakephp框架的分页的方法的文档,是cakephp框架的内容。
Lead you from a basic setup of CakePHP to building a couple applications that will highlight CakePHPs functionality and capabilities without delving too deeply into the PHP language, but rather ...
cakephp中acl详解
cakephp 框架书籍 英文版
cakephp-1.2 manual 英文版,离线版。
cakephp-2.2.4-0 稳定版框架
cakephp-1.3.21.zip
用cakephp实现的简单商城系统,有基本的商城管理功能和会员注册管理功能,代码简洁易懂,直接输入http://域名/install.php...此商城系统是一个比较典型的cakephp案例,比较适合一些有意学习cakephp的人进行研究学习……
cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码cakephp框架源码
在cakephp.org站点的Sites in the wild页面可以看到当前使用CakePHP框架的网站列表。 CakePHP 是一个运用了诸如ActiveRecord、Association Data Mapping、Front Controller和MVC等著名设计模式的快速开发框架。该...
在cakephp.org站点的Sites in the wild页面可以看到当前使用CakePHP框架的网站列表。 CakePHP 是一个运用了诸如ActiveRecord、Association Data Mapping、Front Controller和MVC等著名设计模式的快速开发框架。该...
在cakephp.org站点的Sites in the wild页面可以看到当前使用CakePHP框架的网站列表。CakePHP 是一个运用了诸如ActiveRecord、Association Data Mapping、Front Controller和MVC等著名设计模式的快速开发框架。该项目...