Adding ability to read cookies in the Controller::beforeFilter()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5304 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-06-20 02:18:36 +00:00
parent 02d6c55d9f
commit a80be72ff3

View file

@ -256,6 +256,10 @@ class CookieComponent extends Object {
* @access public
*/
function read($key = null) {
if(empty($this->__values) && isset($_COOKIE[$this->name])) {
$this->__values = $this->__decrypt($_COOKIE[$this->name]);
}
if(is_null($key)){
return $this->__values;
}