On Jun 4, 8:59 am, ytji <[EMAIL PROTECTED]> wrote:
> hi,thomas
>   i doubt it's cake's bug. i meet the same question.
>   when cache is on, the before_filter() of app_controller does not
> called anyway.
>   in my case,i use othAuth component to check user session .when the
> cache is off,everything is ok,but when it's on, i can't called
> othAth's session check function which is placed in before_filter() in
> app_controller.php.
>
>         function beforeFilter()
>         {
>                 //die('in app controller');
>                 $auth_conf = array(
>                                         'mode'  => 'oth',
>                                         'login_page'  => '/users/login',
>                                         'logout_page' => '/users/logout',
>                                         'hashkey'     => 'MdfEcEeTHaSHKeYz',
>                                         'noaccess_page' => '/admin/noaccess',
>                                         'strict_gid_check' => false);
>
>                 $this->othAuth->controller = &$this;
>                 $this->othAuth->init($auth_conf);
>                 $this->othAuth->check();
>         }
>     it's really bothering me too!

When a cache file is rendered, NO controller code is run. If there
was, what would be the point of using cache? If you want to restrict
access to a cached page you need to put something IN the view file
(check for session var and redirect) or find a different solution (if
your logic is more complex than that, such as caching the data used
and not the view.) or turn off caching.

hth,

AD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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