1. They show that the cookie is a property of the object “document”
2. The cookie is dismembered with a function called split() that forms an array. The  element of the array is the name of the cookie and the  element of the array is the value.
3. Normally a cookie expires when the session with the browser is closed. However, in the case of cookie1.html the expire time is set to the current month plus 6. This is started in the line right after expireDate = new Date. The cookie is formed when document.cookie is loaded in function setCookie() .
4. The text box for entering data is creaeted at the 3rd line from the bottom. Note that when the text box is exited, i.e. onblur the function setcookie() is called.
The page cookieRead.html simply reads the cookie that was written by cookie1.html. Note that it will read only cookies written by your access to the server with the same machine. Cookies can only be read by the writer. Cookies on one machine are not visible to any other machine.
Note that the cookie is read by document.cookie.split(“=”) which reads the cookie value, which in this case should be a name.
Let me know if you have trouble with this.
Cookies can be a lot more sophisticated. For instance, a cookie value could be used to locate information about the user that is stored in a database on the server. Cookies are limited to 4K bytes, but a database could hold unlimited information related to the cookie.
If password validation is done with cookies, it should be simple, such as testing whether or not the pw was typed correctly into 2 different fields. Any password validation on the client side is in my opinion risky.