如何在CodeIgniter中检索Cookie值? [英] How to retrieve cookie value in CodeIgniter?
本文介绍了如何在CodeIgniter中检索Cookie值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以通过 print_r($ this-> session-> userdata);
打印codeigniter中的会话值如何打印codeigniter?我刚刚设置了一个cookie:
I can print the session values in codeigniter by print_r($this->session->userdata);
How can I print the cookies in codeigniter? I have just set a cookie:
$cookie = array(
'name' => 'test_cookie',
'value' => 'test',
'domain' => '/',
'secure' => TRUE
);
$this->input->set_cookie($cookie);
如何打印上述cookie?
How can i print the above cookie?
推荐答案
查看文档: Codeigniter Cookie帮助指南
它表示您应该使用 $ this-> input-> cookie()
检索Cookie:
It says that you should use $this->input->cookie()
to retrieve a cookie:
$this->input->cookie('test_cookie', TRUE);
这篇关于如何在CodeIgniter中检索Cookie值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文