Password Reset Link Expiry

浪尽此生 提交于 2019-12-06 09:29:58

Add a field to the users table with a timestamp when a password reset is requested. When you check if the key matches check the timestamp to see how old it is.

Is this what you mean?

The way I do this is to store both the hash that you send the user and the timestamp from when it was generated in the users table.

When they visit the reset page check the hash they give against the one in the database rather than generating it again (doing it this way you can use truly random hashes as you don't have to remember how it was created in the first place) and also check the timestamp.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!