Download the PHP package weshooper/php-password-workflow without Composer
On this page you can find all versions of the php package weshooper/php-password-workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package php-password-workflow
PHP email tokens
Used in password reset (or sign up verification) emails, these need to be:
- Entirely random
- Short, containing only simple (0-9, A-Z and a-z) characters (to avoid email problems)
- Expiring within a short period of time (though still dependent on security of users mailbox)
- Deleted once used and/or expired (this bit is down to you!)
- Hashed when stored in the database (like passwords, so useless if read via SQL injection or worse)
Sample code for forgot_password.php
Tip: better to put the user in a queue, then generate tokens/emails in a worker/cron.
Sample code for reset_password.php
Options
An array can be passed in the constructor to override defaults:
- Token expiry period: the 15 minute default allows for email delivery delays, but lowers the risk of emails sitting around in a possibly unattended email client
- Token length: the 24 character default is nice and short for emails, but gives ~10,000,000,000,000,000,000,000,000,000,000,000,000,000,000 combinations for the 62 case-sensitive alphanumeric characters used - impossible to brute-force successfully (20 or more is recommended)
Helpers
There are two helper functions:
Credits
Comments, advice and code from Martin Stoeckli were invaluable in getting my knowledge and understanding to the point of being happy with all this - thanks Martin! :-)
All versions of php-password-workflow with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
ext-mbstring Version ^8.0
nesbot/carbon Version ^2.0
tuupola/base62 Version ^2.0
ext-mbstring Version ^8.0
nesbot/carbon Version ^2.0
tuupola/base62 Version ^2.0
The package weshooper/php-password-workflow contains the following files
Loading the files please wait ....