Welcome Guest, Not a member yet? Register   Sign In
Cookie so yummy?
#1

[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.

#2

[eluser]whygod[/eluser]
I'm trying to retrieve the cookie information,
using the get_choco() method that I created.
But it won't display anything.
Any help please.
#3

[eluser]InsiteFX[/eluser]
Code:
'secure' => FALSE

secure true is for https not http.




Theme © iAndrew 2016 - Forum software by © MyBB