CI_Input::cookie()

cookie([$index = NULL[, $xss_clean = NULL]])

Parameters:
  • $index (mixed) – COOKIE name
  • $xss_clean (bool) – Whether to apply XSS filtering
Returns:

$_COOKIE if no parameters supplied, otherwise the COOKIE value if found or NULL if not

Return type:

mixed

This method is identical to post() and get(), only it fetches cookie data:

$this->input->cookie('some_cookie');
$this->input->cookie('some_cookie, TRUE); // with XSS filter

To return an array of multiple cookie values, pass all the required keys as an array.

$this->input->cookie(array('some_cookie', 'some_cookie2'));

Note

Unlike the Cookie Helper function get_cookie(), this method does NOT prepend your configured $config['cookie_prefix'] value.

doc_CodeIgniter
2016-10-15 16:31:38
Comments
Leave a Comment

Please login to continue.