如何在 CodeIgniter 中检索 cookie 值? [英] How to retrieve cookie value in CodeIgniter?
本文介绍了如何在 CodeIgniter 中检索 cookie 值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以通过 print_r($this->session->userdata);
在 codeigniter 中打印会话值如何在 codeigniter 中打印 cookie?我刚刚设置了一个 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?
推荐答案
它说你应该使用 $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屋!
查看全文