val e9dd38c3a8 commit fonctionne ou pas ? | 1 year ago | |
---|---|---|
.. | ||
example | 1 year ago | |
src | 1 year ago | |
test | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
composer.json | 1 year ago | |
phpunit.xml | 1 year ago |
This library implements the best practices for implementing a secure "Remember Me" functionality on web sites. Login information and unique secure tokens are stored in a cookie. If the user visits the site, the login information from the cookie is compared to information stored on the server. If the tokens match, the user is logged in. A user can have login cookies on several computers/browsers.
This library is heavily inspired by Barry Jaspan's article "Improved Persistent Login Cookie Best Practice". The library protects against the following attack scenarios:
composer require birke/rememberme
See the example
directory for an example.
The generated tokens are pseudo-random and the storage classes use the SHA1 algorithm
to hash them. If you need better security than that, overwrite the
Authenticator::generateToken
method to generate a truly random token. If you are
using PHP >=5.5 you can use the "password_hash" and "password_verify" functions.
On lower PHP versions you could use the userland implementations of these functions.