[eluser]whygod[/eluser]
Hi guys
I'm trying to set and get a cookie,
setting a cookie,
Code:
//set cookie
function set_choco()
{
$cookie = array(
'name' => 'jaz_auth',
'value' => 'The Value',
'expire' => '86500',
'domain' => '.sample.com',
'path' => '/',
'prefix' => 'sample_',
'secure' => TRUE
);
$this->input->set_cookie($cookie);
echo 'cookie set.';
}
getting a cookie,
Code:
//get cookie
function get_choco()
{
$my_cookie = $this->input->cookie('sample_jaz_auth');
echo '<pre>';
print_r($my_cookie);
echo '<pre>';
echo $my_cookie;
}
As you can see I'm trying to fetch the cookie name and echo the content,
but unfortunately I don't see anything from it.
Anyone would like to help me out with this.
How can I echo the value of my cookie after I set it?
Thanks in advanced.