But then I wonder how I do that?
I mean, there is a lot of magic going on, my login looks like this:

public function login() {
   if ($this->Auth->login()) {
   ...

What do I have to do that the cookie creation happens before the login 
happens?

Mark, I am so thankful that you are helping me, even on a Sunday and 
Eastern!!





Am Sonntag, 8. April 2012 13:44:32 UTC+2 schrieb euromark:
>
> of course it will
> If $user is not empty - and you already have a logged in user
>
> the cookie willl only be created upon login just before the redirect
>
>
> Am Sonntag, 8. April 2012 13:20:15 UTC+2 schrieb heohni:
>>
>> Because it runs still into the if , do the return; and the script stops 
>> at this point for me.
>> That is my problem :-)
>> This way the cookie will never be created.
>>
>> Am Sonntag, 8. April 2012 13:07:06 UTC+2 schrieb euromark:
>>>
>>> so where is your problem?
>>> looking at your debug statement, everything is all right
>>> ! <=> NOT
>>> so
>>> !true === false
>>>
>>> and it will only run into the skip if it would be true (and active would 
>>> be false) here
>>>
>>>
>>>
>>> Am Sonntag, 8. April 2012 12:51:11 UTC+2 schrieb heohni:
>>>>
>>>> If I do a debug($this->settings);
>>>> I get
>>>>
>>>> array(
>>>>    'password' => '*****',
>>>>    'active' => true,
>>>>    'model' => 'User',
>>>>    'username' => 'username',
>>>>    'plugin' => '',
>>>>    'controller' => 'users',
>>>>    'loginAction' => 'login',
>>>>    'logoutAction' => 'logout',
>>>>    'cookieName' => 'autoLogin',
>>>>    'expires' => '+2 weeks',
>>>>    'redirect' => false,
>>>>    'requirePrompt' => true,
>>>>    'debug' => null
>>>> )
>>>>
>>>> if (!$this->settings['active'] || !empty($user) || !$cookie || 
>>>> !$controller->request->is('get')) {
>>>> debug(!$this->settings['active']); => false
>>>> debug(!empty($user)); => false
>>>> debug(!$cookie); => true
>>>> debug(!$controller->request->is('get')); => true
>>>>
>>>>
>>>>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to