A form which remembers who you are - securely.

Need a form which can remember when some visited and offer to send them an one time code via email to get their previous details back.

How do we break this down to first principles?