title: Best way for a 'forgot password' implementation?
body: <p>I'm looking for the best method to implement a "forgot password" feature.</p>
  
  <p>I come out with 2 ideas:</p>
  
  <ol>
  <li><p>When user click on forgot password, the user is required to key in the username, email and maybe date of birth or last name. Then a mail with temporary password will be sent to the user email account. The user uses the temporary password to login and resets his password.</p></li>
  <li><p>Similar, but the email would contain a link to let the user reset his password.</p></li>
  </ol>
  
  <p>Or anyone can suggest me a better and secure way? I'm also thinking to send the temporary password or link, force the user to reset the password within 24 hour, or else the temporary password or link will not be usable. How to do that?</p>