Heh, problem solved...
I had:
Configure::write('Session.cookie', 'ADMIN panel');
When I removed lowercased letters and space session works perfect.
It's a bug or a feature? :) The name of CakePHP's session cookie
always must be uppercase and without spaces?
On 25 Sty, 17:19, red <[EMAIL PROTECTED]> wrote:
> Another thing:
>
> function login() {
> echo "<pre>";
> var_dump($this->Auth->user());
> echo "</pre>";
> }
>
> and
>
> $this->Auth->autoRedirect = false;
>
> So when I click Login I see:
>
> array(1) {
> ["User"]=>
> array(6) {
> ["id"]=>
> string(1) "1"
> ["login"]=>
> string(6) "root"
> ["group_id"]=>
> string(1) "1"
> ["active"]=>
> string(1) "1"
> ["created"]=>
> NULL
> ["modified"]=>
> NULL
> }
>
> }
>
> Perfect! Now I'm just opening new tab in Firefox and enter /users/
> login and I get NULL! That's totally weird.
>
> On 25 Sty, 17:12, red <[EMAIL PROTECTED]> wrote:
>
> > I've tried - it's not problem with redirecting :(
> > It looks like this:
>
> > 1. I'm entering /admin/customers/index
> > 2. It redirects me to /users/login, I'm entering data and click Login
> > 3. I'm still on the /users/login :(
> > 4. When I set $this->Auth->autoRedirect = false; I can see this debug
> > with affected rows = 1
> > 5. But when I try to get any actions it still redirect's me to the
> > login page... Damn.
>
> > On 25 Sty, 17:05, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > On Jan 25, 2008 10:57 AM, red <[EMAIL PROTECTED]> wrote:
>
> > > > function beforeFilter() {
> > > > $admin = Configure::read('Routing.admin');
>
> > > > $this->Auth->userModel = 'User';
> > > > $this->Auth->fields = array('username' => 'login',
> > > > 'password' =>
> > > > 'password');
>
> > > > $this->Auth->loginAction = array('controller' =>
> > > > 'users', 'action'
> > > > => 'login', $admin => false);
> > > > $this->Auth->loginRedirect = array('controller' =>
> > > > 'customers',
> > > > 'action' => 'admin_index');
> > > > $this->Auth->logoutRedirect = '/';
> > > > $this->Auth->loginError = "Sorry, wrong login or
> > > > password.";
>
> > > > $this->Auth->authorize = 'controller';
> > > > }
>
> > > I believe that you've defined the loginRedirect and loginAction
> > > incorrectly
>
> > > $this->Auth->loginAction = array('controller' => 'users', 'action' =>
> > > 'login', 'admin' => false);
> > > $this->Auth->loginRedirect = array('controller' => 'customers',
> > > 'action' => 'index', 'admin' => true);
>
> > > Try that and I hope it helps.
>
> > > --
> > > Chris Hartjes
> > > Internet Loudmouth
> > > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---