I read about many old questions about this argument, and I thought that the best practice is to set up a cookie with username,user_id and a random
username
user_id
My approach is the following:
md5(current_timestamp)
So far, It has been working great for me :)