Using hash to store data on cookies