Development JavaScript Tutorial

var cookieName = document.cookie;
This statement creates the variable cookieName and assigns it the cookie property of the document object.
The cookie property itself returns a string containing all the cookies pertaining to the current document.
Cookies are interpreted in name/value pairs.