DEV Community

Junaidul Islam Jarif
Junaidul Islam Jarif

Posted on

When You Need Unique Users but Can’t Force Login

I got a course project where I need to present some information and then collect user data through a survey. While working on it, one major concern was how to ensure that each user submits only one unique response.

The most straightforward solution is to use an email-based authentication system, such as Google login. However, this approach felt like overkill for a simple survey website. Additionally, many users are reluctant to participate in surveys when there is no incentive or reward involved.

To avoid a full authentication system, I considered IP-based identification, where users are identified by their IP addresses. I implemented this solution, but I quickly realized its limitations. IP addresses can change frequently, especially on mobile devices when users are traveling. I initially assumed this method might work better for desktop users, but that assumption turned out to be wrong. Even from my home network, I was able to submit multiple votes after some time.

At first, I suspected that refreshing the page might remove the restriction, but that wasn’t the case. The issue seems more complex, and I am still investigating the exact reason behind this behavior.

Next, I explored using cookies to identify users. This solution also has significant drawbacks. If users switch devices—such as moving from a mobile phone to a desktop or laptop—it becomes impossible to prevent multiple responses. Furthermore, some browsers and browser extensions block cookies by default, making this method unreliable.

Through this research, I came to the harsh realization that reliably identifying unique users is extremely difficult without a traditional authentication system like Google login.

Ultimately, every approach has its advantages and disadvantages, and the best solution depends on the specific requirements and constraints of the project.

Project Link: https://face-rank.vercel.app/

Top comments (0)