Retriving password,if users forgot password

hi rails gals and guys
im creating authentication using username and password,i wants to
know how to retrive the username and password,if user forgot the
username and password by asking secret question and secret answer
e.g : what is your pet’s name?

if anyone knows how to implement tis,plz send your suggestions and


i would just create a separate db table for this. Generate some sort of
hash and urlencode it into a “click here to create new password” link in

when user clicks the url in the email they got, rails matches the md5
string in the URL against an entry in the DB. If its there, delete the
record , update user with a temp pass in the user table, and email it to

Make sure to clean up the table every few days. IF they dont update
pass those records should be purged frequently.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs