Have a look at the Auth session key. It ought to have a ['User'] key. I have 
noticed that on occasions it gets a ['User']['User'] key when doing a manual 
login. If that's the case, you just need to check the shape of the array you 
pass in to the login function. Might not be the answer, but I've had issues 
here myself before.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 3 May 2013, at 05:56:00, lhas <luizhr...@gmail.com> wrote:

> Hi, people!
> 
> I'm doing a manual login action, where i find the user based on your username 
> (findByUsername).
> 
> If the user exists, i want to force login the user to the AuthComponent. 
> Else, i register the user (success).
> 
> When i try to force the login of the user, i have a some kind of bug:
> 
> I try to login like this:
> 
> $this->Auth->login($user_exists['User']);
> 
> Where $user_exists['User'] contains all the User array with all the user data 
> from the findByUsername.
> 
> After the $this->Auth->login(), i can debug, for example, 
> AuthComponent::user().
> 
> But when i redirect the user to another action, the Auth seems not to work. 
> Its like the manual login doesn't worked, and the user is redirected to the 
> login action again.
> 
> Someone knows what i doing wrong?
> 
> I will be very prettyful for some help. :)
> 
> Thanks for my possible bad english!
> 
> Cheers,
> @luizhrqas.
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to