Roman Roman - 2 months ago 16x
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?


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);