If i were you i would think "how can i use sessions in components ?
hmmm let me think... auth component stores info in session - maybe ill
look at its source and find out ?"
not long after i would find mysqlf on one of the greatest resources : The API

http://api.cakephp.org/1.2/class_auth_component.html#078aa537197139b444bc51826cfad95e
http://api.cakephp.org/1.2/auth_8php-source.html#l00055

HTH,
--
Marcin Domanski
http://kabturek.info



On Wed, Sep 10, 2008 at 10:44 PM, Marcus J. Ertl <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> I'm just trying to cache the results of acl's check in the session. I
> have written a new component, inheriting from DbAcl:
>
> class CachedAclComponent extends DbAcl {
>
>    function check($aro, $aco, $action = "*") {
>        return parent::check($aro, $aco, $action);
>        $key = 'CachedAcl.'.$aro.'.'.$aco.'.'.$action;
>        if ($this->Session->check($key)) {
>            return $this->Session->read($key);
>        } else {
>            $result = parent::check($aro, $aco, $action);
>            $this->Session->write($key, $result);
>            return $result;
>        }
>    }
> }
>
> and set in conf/core.php:
>
> Configure::write('Acl.classname', 'Cached_Acl');
>
> Acl now uses my check-methode. But there is one thing, that doesn't
> work: The session! I can't find any way to write to the session in this
> class. I've tried many things, but nothing worked for me! :-(
>
> Bye
> Marcus
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to