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? Thanks ...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---