I'd like to know what methods usually web applications employ in order to detect multiple accounts, supposing that the application wants its users to create a single account .
Use the user's email address as his login (username). Store the email address as a unique key in your database. Not foolproof, of course. Then again, few things are. I'd avoid the temptation of using IP address. You'll get the same user logging in from multiple IP addresses if his ISP uses dynamic IP assignment. Conversely, many users can share a single globally-visible IP address.
Ip Address is the most obvious sign that multiple accounts may be used. This is flawed if two people from the same IP have an account
I haven't implemented such a solution, but I think that you may use one or more of:
- Setting & checking a cookie
- Using sessions
- Storing the user IP
- Cross-referencing the details (address, city etc)
Most of the apps I've seen/written are based on a unique email address. If you've got more than one email address, you can apply for more than one account.
If it needs to be more complicated than that...I'd question why you want a user to have only one account.
Two people might share an IP, if they have several computers on a LAN, or their IPs are assigned dynamically. You can use a cookie to track the last username they logged in with. Then when they log in with a different name, you know the same browser's been used to access multiple accounts. You can use Flash's storage to get around them clearing their browser cookies.
In most cases its simplest just not to care if a user has more than one account. If its a situation where you are offering like x free per account and you want them to pay for extra your pretty limited. If you have any uniquely identifiable that they can't lie about like address if they want you to send stuff to them you can disallow duplicates. If its a really big problem I would add extra captcha or email validation steps if you detect a duplicate IP address. That way you don't disallow a legitimate duplicate but you'll hopeful force moochers to just pay instead of going through the hoops.