I just guess, maybe I should spend some time to find the really fail reason of my application.
On Thu, Mar 5, 2009 at 9:25 AM, joshua <[email protected]> wrote: > Thanks all of your reply! Many appreciate! > I find the problem, > > Model::User: > function validateLogin($data){ > //... > } > > AppController::beforeFilter(){ > //here I validate the login data, > if(($user = $this->User->validateLogin($thid->data))){ > //store this user in Session > $this->Session->write('user', $user); > } > > } > > UserController::login(){ > //Here I validate second time and rewrite the session for this user > if(($user = $this->User->validateLogin($thid->data))){ > //store this user in Session > $this->Session->write('user', $user); > } > //.... > } > > My solution: > Remove the validate in UserController::login(),like this: > UserController::login(){ > //.... > } > > It works again. So is that means the Session couldn't be wrote twice? > > > > On Wed, Mar 4, 2009 at 11:44 PM, persivo_cunha <[email protected]> wrote: > >> >> You can put Auth in App Controller and it will work fine, and you can >> override it in UsersController. In this controller, you can write >> >> beforeFilter() { >> parent::beforeFilter(); // this line will call the AppController's >> beforeFilter line 1 >> .... >> } >> >> and after line 1, you can put new allow/deny commands and they will >> replace the old allow/deny. >> >> >> >> >> > > > -- > Thanks > Joshua > -- Thanks Joshua --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
