Welcome Guest, Not a member yet? Register   Sign In
Error Accessing Cookie Helper?
#1

[eluser]Vik[/eluser]
I must be making some very obvious error here.

Code:
$this->load->helper('cookie');
$S = $this->cookie->get_cookie('cookie_name');

No error is thrown by the load->helper line, but the next line throws the error:

Quote:Call to a member function get_cookie() on a non-object

What am I missing?

UPDATE: Oh - you just have to say get_cookie, not $this->cookie->get_cookie. Smile
#2

[eluser]Aken[/eluser]
Yup, helpers are stand-alone functions that are not part of a class, so they are called by themselves, same as a standard PHP function is used.




Theme © iAndrew 2016 - Forum software by © MyBB