The cookie property is used to store information for the viewer.
A cookie is a small text file saved to viewer’s computer for a certain amount of time.
document.cookie = string;
You have to replace the word string with the text string that contains information you want to use.
document.cookie = "site = homepage"