Basically You want to keep track of 2 types of people -
- New user
- old user
1st solution
suppose a new user visits a page then set a cookie in their browser like visited like marking the seeps in a herd .
then check when a user visits your website has a cookie set or not if set then do treat him as a old sheep or its a new born .
Pros
No need of a server
cons
if mark/cookie deleted or tampered then a dyeing old sheep is gonna treat as a new born which is weird and not a good experience for that user.
Method 2
Make your all user to register , then redirect them login .
allocate every ship a unique id like sheep1 , sheep2
then keep track of their progress . like
sheep1 ---> 8 year old & producing 4 liter milk a day
sheep2 ---> 3 year old & pregnant
sheep3 ---> 11 year old & only eating , probably gonna die
Now
when a user login then set their unique key in cookie
Now keeping track and smoothing user Experience
when a user visits your page check he has that unique key if yes then validate it from server then if invalid then force him to login.
Now ask the server to give data about that unique key .
and CHECK THEIR PROGRESS & TREAT THEM HOW YOU LIKE ---
At last user is happy with this treatment and you are producing more Milk