Cookie Helper
Cookie Helper 中包含了多个cookie辅助函数.
装载这个 helper
这个 helper 可以通过下面的方法来装载:
$this->load->helper('cookie');
下面这种方法同样可以:
set_cookie()
This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().
get_cookie()
This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().
delete_cookie()
可以让你删除一个cookie,除非你设置了一个自定义的路径或者其他变量,否则只要给出cookie的名字就行了:
delete_cookie("name");
这个函数与set_cookie()函数比较像, 除了它没有值和超时参数. 你可以把一个数组作为第一个参数提交,也可以像下面这样,设置独立的参数.
delete_cookie($name, $domain, $path, $prefix)
翻译贡献者:
498621, billycui, Hex, pipi95, tonera
最后修改: 2011-02-01 00:08:36