Roman Roman - 1 year ago 171
PHP Question

How to retrieve cookie value in CodeIgniter?

I can print the session values in codeigniter by


How can I print the cookies in codeigniter? I have just set a cookie:

$cookie = array(
'name' => 'test_cookie',
'value' => 'test',
'domain' => '/',
'secure' => TRUE


How can i print the above cookie?

Answer Source

Look at the documentation: Codeigniter Cookie Helper Guide

It says that you should use $this->input->cookie() to retrieve a cookie:

$this->input->cookie('test_cookie', TRUE);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download