Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What if someone tries to register with an email that's not theirs. When they register, they get emailed a verification code to complete registration. If that's not their email, they don't get it, so they don't confirm.

How long should I keep this account in the db? I'm thinking 2 hours then delete the account. First is 2 hours enough? Second, is there any reason I should not delete the record with all its info (username,password, etc)?

share|improve this question

migrated from stackoverflow.com Feb 15 '11 at 17:38

6 Answers

I would wait 24hours. If the user doesn't get the email straight away, they might walk away from their computer. I think 24 hours is a reasonable time to expect them to verify. I'm pretty sure I've registered for stuff then not confirmed straight away.

I would say yes you should delete everything. Why keep it? In the UK, I think you'd be obliged to if any of the data is personal (name, date of birth, email address, etc)... you should check data protection laws in your country.

share|improve this answer
+1 for pointing out that storing the data forever would be highly unethical and, in many places, illegal. – Tomalak Geret'kal Feb 15 '11 at 10:09
@Nathan None of the information is sensitive like what you're describing,. The reason I want to delete it is that it makes things easier if the email owner wants to re-register. – zmol Feb 15 '11 at 11:30
Yes, it does make it easier to let someone re-register, and I can't really see any advantages to keeping it. I don't think the "spam prevention" method that someone else mentioned has any advantages at all. – Nathan MacInnes Feb 15 '11 at 11:34
2  
I would go for 72hrs. Our email server really locks down external emails (we have to get addresses white-listed if we want them to arrive quickly) And registration emails can take a while, especially if it was a Friday afternoon that I signed up, I likely won't get the email that day, and have to wait until Monday to verify it. – CaffGeek Feb 15 '11 at 17:54

You need to work in days, not hours for this.

Case in point: I registered with a site from work a few months ago. They sent a confirmation email, but the office Exchange server was down, so my emails weren't getting through. It was a Friday afternoon, so in the end I only got the confirmation email on the Monday morning.

It could have been longer if there had been a public holiday on the monday, or if I'd been planning any time off work the following week (although I guess just possibly I wouldn't have done the signup on Friday afternoon if it was my last day in the office before a break!)

share|improve this answer

2 hours is not nearly long enough - some mail servers can hold mail for up to 24 hours before delivering it.

I would say at least 24, possibly up to 48 hours before deleting the account.

edit: And for the second question (sorry, didn't see it) it may be worth holding onto the email address, just in case you get repeat offenders who like to spam other people with these verification emails. If they register-and-don't-verify x number of times, perhaps blacklist them.

share|improve this answer
Those servers suck. But you are absolutely right. – ThiefMaster Feb 15 '11 at 10:05
+1 for being right. – Tomalak Geret'kal Feb 15 '11 at 10:08
2  
@ThiefMaster: It's not the servers' fault. If the destination is offline, then the mail servers kindly cache the email and keep retrying it. It's only after 24/48 hours that they tend to give up. They don't "suck"; they are doing you a great service by not just giving up first time when your own mail daemon is down! – Tomalak Geret'kal Feb 15 '11 at 10:10
1  
I was thinking about broken greylisting. I've seen servers retrying to the the email only after hours instead of seconds/minutes. – ThiefMaster Feb 15 '11 at 10:10

It can take quite a while for an email to be delivered - even longer than 24 hours if there are server issues along the way. You user might simply do something else for a few hours and come back to complete registration later.

I would keep an account for at least 7 days and then consider removing unverified accounts. If my account expired before I had a chance to confirm it, I would certainly think twice about completing a registration form again.

share|improve this answer

You may create no account at all:

Easiest way for php email verification link.

validation link via email

share|improve this answer

I would assume, that there will be a significant amount of users that do not complete their registration within 2 hours. You also want to take into account that there are mail servers that do greylisting as part of their spam filtering, which means they reject mail from senders they don't know and accept it when it gets sent a second time. How long that process takes depends on how long your own mail server waits until he sends an email a second time.

Further there are probably people that don't look into their mail accounts that often, signing up and trying to verify a day later or so.

I would hold the unverified accounts for a week, then it should be pretty save to drop them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.