how symfony2 remember me work without any table for token?

531 views Asked by At

I configure symfony2 to add remember me functionality, but how it work without any table in database to save remember me token. I mean some best practice for remember me cookie like what is said in here

1

There are 1 answers

0
zerkms On BEST ANSWER

It stores the username and the token expiration together with the token class name and the signature in the single cookie.

Here is where it's being processed: https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php#L39

So the whole protection is based on using the secret token (the one you specify in parameters) and user's password.

Answering the second part of your "question" - as soon as a pure cookie-based solution does not use persistence layer, none of those "best practices" are applicable here.

symfony2 does provide built-in persistence layer support for storing remember-me tokens, and it does implement the series-based logic like it's explained in the answer you're referring to.