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.



Messages In This Thread
Cookie so yummy? - by El Forum - 11-18-2012, 07:24 AM
Cookie so yummy? - by El Forum - 11-18-2012, 10:55 AM
Cookie so yummy? - by El Forum - 11-18-2012, 12:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB