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!



On 5月29日, 上午5时07分, thomahawk <[EMAIL PROTECTED]> wrote:
> I am doing my first cake app. and had a go with the cache and the
> simple user authentication examplified in the user guide. My problem
> is, however, that as soon as I turn on cache, my check for a session
> variable is not done - seemingly.
>
> The session var is the user object which is saved upon login.
> In app_controller I have a function
>
>       function checkSession() {
>                if(!($this->Session->check('User')) {
>                       $this->redirect('/users/login');
>                       exit();
>                }
>       }
>
> which is called by using beforeFilter() in each controller.
> When the user hits "logout", the session var is deleted and is
> redirected to login-page.
> If the user tries to enter a valid url, the checkSession() should be
> run. This doesn't happen if the cache is turned on (the effect is not
> visible, nevertheless). The page is rendered.
>
> What am I doing wrong? Is the cache read and output before dispatcher
> takes control if the cache is turned on??
>
> Please, help!
>
> An other thing; debug level 3 doesn't work properly. I never get any
> object dump, only sql log.
>
> t.


--~--~---------~--~----~------------~-------~--~----~
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