python - What is the best practice for registering a new user in my case? -


i going let new users register on service. here way think should go: 1. user enters email in field , clicks register button. 2. user receives confirmation email link containing verification code. 3. user goes link email message sees message account activated now.

so, main point figure out how implement second one. how better generate code? should generate when user clicks register button , save in field, "verification_code" near field "email" , when goes verification link, compare values? then, if that's fine, clear "verification_code" field , set "user_is_active" field "true". or may don't have keep code in database @ all, make in time verification algorithm? may there other things should consider?

i've found useful put verification code in database , use you've suggested. same field can double duty e.g. password reset requests.

i use expiry timeout field, registrations or password resets need dealt user in timely fashion.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -