As a cookie expires it is no longer saved to the hard drive. There are six parts of a cookie : name, value, expires, path, domain, and security. The first two parts i.e. name and value are required and rest parts are optional. document.