I finally got it working.  Cakephp was deleting my session everytime I
went to login page somehow.
I dont have delete session in the controller

class UsersController extends AppController
{
      var $name = 'Users';
    var $scaffold;

     function index() {

          }
    function login()
    {


               $error = false;

            $success = false;

               if (!empty($this->data))
        {

             $someone = $this->User->findByUsername($this-
>params['data']['User']['username']);
             if(is_array($someone))
             {

                    if(md5($this->data['User']['password']) ==
$someone['User']['password'])
                    {
                        $success = true;
                    }

             }
            if($success)
            {
                 $this->Session->write('User', $someone['User']);
                            $this->redirect('/hunters/index');
                return true;
            }
            else
             {

            $this->Session->setFlash("Login Failed");

             }


         }
          $this->set('error', $error);
    }

    function logout()
    {
        $this->Session->delete('User');
        $this->Session->setFlash('Logged out');
        $this->redirect('/');
        return true;
    }

}


Does Cakephp preload functions or something?


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