On Nov 1, 11:43 am, Rhee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I use checkSession() in AppController to check if the user logged in
> or not and I also put $beforeFilter in AppController.
> Basically it does work. But as soon as I need this function for almost
> any views in UserController, it doesn't redirect me to login page.
>
> The code in AppController:
>
>         var $beforeFilter = array('checkSession');
>
>         function checkSession()
>         {
>                 if (!$this->Session->check('User'))
>                 {
>                         if ($this->params['controller'] != 'users' && 
> $this->params['action'] != 'login')
>
>                         {
>                                 $this->redirect('/users/login/');
>                                 exit();
>                         }
>                 }
>         }
>
> Any suggestion?

Debug? call parent in the before filter you have in your users
controller?

hth,

AD
ps $this->name and $this->action are less typing


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