Page 1 of 5
1 · 2 · 3 · 4 · 5

Paul Gardner :: 07.12.2008 15:34:27
I came to this component page from your comment on the http://bakery.cakephp.org/articles/view/remember-me-a-component-to-add-upon-basic-auth bakery article in the hope your solution would work but I am having no joy.

Not sure if I'm being daft but it seems you missed out two things above:

1. Need to add 'RememberMe' component to AppController
2. Add a 'User.remember_me' checkbox to the login form

Despite doing these things the RememberMe->check() function keeps returning at the following point.

if (!is_array($cookie) || $this->Auth->user())
return;

A cookie never gets created ... any ideas?
lecterror :: 08.12.2008 05:35:31
Hi Paul!

I'm sorry to hear you're having trouble. For the rest of the code please refer to my previous articles on the subject, or download NeutrinoCMS (beta) for a live example (I'm using it on this site and can confirm that it works). Hope that will help!

Good luck!
Paul Gardner :: 08.12.2008 09:05:26
Could it be something to do with the fact I am running my site securely? (i.e. on https://)
lecterror :: 09.12.2008 08:41:51
It is possible. I've never used cookies over SSL, but as far as I know, if you write a cookie over SSL it will be readable over SSL only and not by regular HTTP. So basically, check if you're reading and writing over the same protocol :)

Although it is strange that you cookie is never created.. could your browser settings be messed up?

In any case, good luck!
alex :: 03.01.2009 13:32:40
Couple of points:

1. AppController also needs the 'Auth' component, before 'RememberMe'.

2. UserController cannot have a beforeFilter (such as $this->Auth->allow()), as this seems to conflict with the beforeFilter of the AppController. I had to move everything to the beforeFilter of the AppController.