In cake 2.0 I am using the cookie object as follows:
function beforeFilter() {
parent::beforeFilter();
...
$this->Cookie->name = 'cookie';
$this->Cookie->time = '28 days';
$this->Cookie->path = '/domain/';
$this->Cookie->domain = 'domain.com'; // I hope this is OK, I'm testing
on localhost
$this->Cookie->secure = false;
$this->Cookie->key = '<confidential>';
$this->Cookie->httpOnly = false;
}
To save the cookie I am using:
$cookie_data = array(
'min_x' => $this->passedArgs['min_x'],
'min_y' => $this->passedArgs['min_y']
);
$this->Cookie->write('search', $cookie_data);
To read the cookie data I am using:
$min_x = $this->Cookie->read('search.min_x');
... which always returns null for some reason, even though
$this->passedArgs['min_x'] was not null.
Also when I goto IE8->Developer Tools->Cache->View Cookie Information
it says "Developer Tools Error: Could not get the cookie information."
I tried in Chrome but I could not find the function to view cookies.
Thanks.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php