newCookie is a string of the type key=value in the code above. This technique only allows you to set/update a single cookie at a time. Consider also that:
Documents can be used to make cookies. This is a cookie property.
document. Cookie = "cookiename=cookievalue" You may also include an expiration date for your Cookie, which will ensure that it is deleted from the computer on the stated date. The expiration date should be formatted in UTC/GMT. If the expiration date is not specified, the Cookie will be deleted when the user exits the browser.
"cookiename=cookievalue; expires= Thu, 21 Aug 2014 20:00:00 UTC"
document.cookie =
You may optionally give the domain and path to define which domain the Cookie belongs to, as well as the directories inside that domain. A cookie belongs to the page that sets it by default.
You can get to the Cookie using this method, which will show you all of the cookies saved for the current website.
document.cookie = var x