1

Yesterday i went for an interview. There they asked.

"Suppose you have a registration form with no unique attribute for email or username. And a person tries fill the registration form again and again.How to keep the track of user weather he has already filled the form or not. You have to save all the data regarding the users "Even the unregistered one too" for the companies future use. How will you do it without using session and cookies ?"

Till now i have heard about these two methods only. Is there any other method or it was just a tricky one ?

Rahul
  • 1,201
  • 1
  • 10
  • 20
  • you can search saved data in database and compare... –  Aug 11 '13 at 19:04
  • i replied it but they said it will make your database usage heavy as it a website with lot of users. correct answer wasn't in that horizon i hope.. :( – Rahul Aug 11 '13 at 19:07
  • You can use localStorage, but only client side javascript will have access to it. – jcubic Aug 11 '13 at 19:08
  • Rahul: you cant track registered user forever, user can clear everything then combeback to your form for registration again, the only possible way is to create unique index on email field, or compare email and username manually with stored data in database –  Aug 11 '13 at 19:09
  • thanks for your comment @jcubic as u can see they said about storing it for company future usage. So they need to store it server side anyhow. – Rahul Aug 11 '13 at 19:10
  • @Akam this might work for registered user but those who are registering are unregistered one. So how can we track them without session or cookie??? – Rahul Aug 11 '13 at 19:15
  • 1
    @Rahul Btw for this question, you might take a look at [this answer](http://stackoverflow.com/questions/15966812/user-recognition-without-cookies-or-local-storage/16120977#16120977) for some inspiration. I'm sure that for an interview, they wouldn't even follow you if you got that deep :-) – HamZa Aug 11 '13 at 20:10
  • 1
    @HamZa Really helpful. Thanks :) – Rahul Aug 11 '13 at 20:27

2 Answers2

1

I'm not sure if I fully understand your question but it sounds like you want to keep track of how many times a certain person fills out a web form.

I would grab their IP Address using this function:

$ip = $_SERVER['REMOTE_ADDR'];

Then, make a new entry in your SQL database for every submittal of the form. Each entry could have a row in SQL with the IP Address, Email, Name etc.

You can then analyze SQL for whatever information you need.

Does this answer your question?

Max Kellogg
  • 171
  • 1
  • 6
  • Thank you for taking a step forward for answering. But as we can see ip address can be changed. So we can loose the track of user. – Rahul Aug 11 '13 at 22:29
0

I probably would use Canvas Fingerprinting. The GDPR and Browser Fingerprinting: How It Changes the Game for the Sneakiest Web Trackers

Dzintars
  • 913
  • 13
  • 19