Re: Session problem in app_controller

2007-11-01 Thread Grant Cox
I think you'll find that the $this->name is "Users", not "User". For our applications with simple authentication, I define another controller variable called $public_actions, which is an array of action names that do not need any authentication (as there are usually only a couple of these). So,

Session problem in app_controller

2007-11-01 Thread Anoop
Hi I have using the app_controller to redirect the request if the session is not valid.But the page isn't redirecting properly .Firefox has detected that the server is redirecting the request for this address in a way that will never complete. if I comment the lines: $this->redirect('/users/login'

Re: Session problem in app_controller

2007-10-24 Thread Grant Cox
This is because beforeFilter runs on all requests, including on /users/ login . So if you don't explicitly check for this (and any other pages where you don't need to be logged in to access), then it will see you are not logged in, and redirect you to /users/login. This is causing an infinite re

Re: Session problem in app_controller

2007-10-24 Thread [EMAIL PROTECTED]
yeah!! that worked just fine! thanks however, now I'm getting another error by the browser: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. if I comment the lines: $this->redirect('/users/log

Re: Session problem in app_controller

2007-10-24 Thread Gwoo
You should look at the example in the Manual. It does not use __construct(), it uses beforeFilter. The reason for this is the components are not loaded in the constructor of the Controller. http://manual.cakephp.org/appendix/simple_user_auth --~--~-~--~~~---~--~~

Re: Session problem in app_controller

2007-10-24 Thread [EMAIL PROTECTED]
checkSession()) $this->layout = 'default'; else $this->layout = 'login'; } function checkSession() { // If the session info hasn't been set... if (!$this->Session->check('User')) {

Re: Session problem in app_controller

2007-10-24 Thread [EMAIL PROTECTED]
No, but I just added var $components = array('session'); and the error continues. On Oct 24, 1:38 pm, dardosordi <[EMAIL PROTECTED]> wrote: > Are you using the session component? > > On Oct 24, 3:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I'm using cake 1.1.17, and am followi

Re: Session problem in app_controller

2007-10-24 Thread Matt Kosoy
Post the code from your app controller so we can take a look. -m On Oct 24, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm using cake 1.1.17, and am following the Simple User Authentication > example from the manual (http://manual.cakephp.org/appendix/ > simple_user_auth), and I

Re: Session problem in app_controller

2007-10-24 Thread dardosordi
Are you using the session component? On Oct 24, 3:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm using cake 1.1.17, and am following the Simple User Authentication > example from the manual (http://manual.cakephp.org/appendix/ > simple_user_auth), and I get the following error when I

Session problem in app_controller

2007-10-24 Thread [EMAIL PROTECTED]
I'm using cake 1.1.17, and am following the Simple User Authentication example from the manual (http://manual.cakephp.org/appendix/ simple_user_auth), and I get the following error when I write the checkSession function in the app_controller.php file: Notice: Undefined property: PagesController::