Welcome Guest, Not a member yet? Register   Sign In
Basic Cookie Help
#2

[eluser]Jay Turley[/eluser]
[quote author="Jim Higgins" date="1207106975"]I'm having a bit of trouble accessing a cookie using the Cookie Helper. After loading the helper of course, should this work?

$this->_state = 'Some State Name';
set_cookie('state_cookie', $this->_state);
echo 'Get cookie = ' . get_cookie('state');

The get cookie returns nothing. I'm not receiving any errors. I stripped everything down to the basics here.[/quote]

Just guessing, really, since I have yet to use the CI cookie functions, but shouldn't you use the same name for the retrieval as for the setting?

Code:
$this->_state = 'Some State Name';
set_cookie('state_cookie', $this->_state);
echo 'Get cookie = ' . get_cookie('state_cookie');
----------------------------------------^^^^^^^


Messages In This Thread
Basic Cookie Help - by El Forum - 04-01-2008, 04:29 PM
Basic Cookie Help - by El Forum - 04-01-2008, 05:56 PM
Basic Cookie Help - by El Forum - 04-01-2008, 06:16 PM
Basic Cookie Help - by El Forum - 04-02-2008, 10:00 AM
Basic Cookie Help - by El Forum - 04-02-2008, 10:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB