I have been studying the best practices are for email verification of a user who is trying to register on a site. (I am running a laravel installation and this is happening in php, though this is more of a theoretical question). I have a few questions I would like to get some opinions on!
- Would there be any use in storing the activation keys longer than needed? As of now I have set it up to delete the key once the user activates his/her account.
- When I clear the data from the table, post activation, does the space get de-allocated? or is it just emptied?
- Is there a better way to do this process? (I had a vague idea of using a temporary "tokens" table with the key and the email ids as columns, a new row being added every time a registration occurs, which is then deleted once the user confirms (Or, after a particular timeout period)
- Ideally, what should be the size of the generated key? A simple 5 digit alpha numeric code can hold 60 million+ combinations, so is there any real need to hash this?
I've been researching this for a while, my aim is to make my system perfectly scalable and as efficient as I can make it. Any information/discussions are welcome.