This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the best way for checking for unique users.

 
Ankit Chaudhari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a web application which has a login feature.

At the same time, it has few features available to everyone (one who does not login to application)

What is the best way to search for unique users?

(First thought: I was planning to get ip address of each hit and save it in the db. Just doesn't feel right. )

 
fred rosenberger
lowercase baba
Bartender
Posts: 12086
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if two people share a computer - or log in from a public one at a library or community center?

I guess the question (in my mind) comes back to "how do you define a unique user?"
 
Ankit Chaudhari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you have a valid point.

For me user is a computer so I can settle for a unique user to be identified by an unique IP address.

 
Ankit Chaudhari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting the architecture's cap on, Is it a good approach to declare a new IP address as an unique user?

Has anyone worked on this kind of situation before?
 
Winston Gutkowski
Bartender
Pie
Posts: 10109
56
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Chaudhari wrote:Putting the architecture's cap on, Is it a good approach to declare a new IP address as an unique user?

I'd say no, for all the reasons already given. An IP address is just that: an address; you're trying to force it to "be" something different - a user - and that rarely works in the long run. You may also run into situations where the IP address either
(a) isn't visible, or
(b) changes from login to login (for example, if it's allocated by a DHCP server).

Java is an object-oriented language, so why not create a User class tailored to the needs of your app? How and where you store it are up to you; but it's a secondary consideration compared to what it means for your system.

As far as "catchall" users are concerned, Unix has a guest user that is often used as a default. You might want to try something similar.

Winston
 
Ivan Jozsef Balazs
Rancher
Posts: 972
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> You may also run into situations where the IP address

... happens to be the IP address of a corporate firewall.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic