Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth::dont_remember_me() remember anyway.
  • Hi,

    I'm a French student who try to learn FuelPHP, and I have a problem with the remember_me/dont_remember_me function.

    I use the example of this FuelPHP website with this code :

                            if (\Input::param('remember', false))
                            {
                                // create the remember-me cookie
                                $var1 = 'remember' ;
                                \Auth::remember_me();
                            }
                            else
                            {
                                // delete the remember-me cookie if present
                                $var2 = 'dont' ;
                                \Auth::dont_remember_me();
                            }

    and I have added a "Remember me" checkbox.

    So, when I connect myself to my application (everything else about authentication work), if I check or not the "Remember me" checkbox, I'm always remembered (to check it, I turn off and turn on firefox ; I tried it with a real website to see if it was a problem with firefox, but everything works).
    You can see with $var1 and $var2 I check if I'm going into "if" or "else". Even when I go inside else and "\Auth::dont_remember_me()" is called, I'm remembered.

    If someone can help me with that, thanks. I guess I just don't see some obvious thing.

    P.S. I hope my grammar is not so terrible.
  • HarroHarro
    Accepted Answer
    Once you're "remembered", a second cookie is set that will log you in if you're not logged in. If you then remove the "remember_me" cookie, you will still be logged in due to your normal login session. Once that expires (our you logout explicitly) you should be logged out.
  • Thanks, your answer help to find what was wrong.
    My configuration was not good, I thought session was closed when the browser was closed by default, and I thought remember_me was set at true by default ... it was the opposite.
    Now it work perfectly.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion