Hi all,
I've created a password recovery page where if the email address is found then it will create a random string, place it in the row of the user, and email a link to that user with the string appended to the pw reset url.
Like this:
http://example/lostpw.php?uid=f7fae6d010409b02436583984bbf9878
So then I have a GET[uid] on lostpw.php and it generates a new password for the user where uid=uid in the db. Works great!
What I'm wondering is how I can set that link to expire in 3 days or something... or would it be best to have another query after the new pw generation to delete that from the uid db field. Either way I think would work but I have no idea how to have temp links die after X days or what is preferable.
I'm also going to use this scheme to send emails to complete a user signup process. I will want to clean out all those that don't complete for whatever reason automatically.
Thanks you guys!!
phpnoob (but less noob all the time) 😃