Usually, when I’m developing websites which interact with clients, I used to use their usernames or user IDs to save their configs and so on. But now I’m developing a website with no login system and I need to save some things, like “likes”, “Accessed pages” and more.
I’ve tried Internet Protocol (IP) but it won’t work when the visitors are under NAT or Proxy.
How can I create an unique ID for every single user and them save it in my database?
By the way I’m using PHP.
This sounds like a recipe for disaster if you are trying to save user data long term.
I would recommend:
The problem arises when the user clears their browsing history/cookies and now there is no way to retrieve that user’s activity because it’s all based on that hash.
I guess one work-around would be to send an email to the user with their hash and instruct them on how to reinitialize their activity history.
You would have to create a special page where they could enter their hash and your system would reset the cookies on their system.