Setting Cookies The document's cookie property contains data that can be used persistently, meaning that it will last as long as you specify in the expiration date. Below we conver the setting process to a function that can be re-used. It will still last one week, but now the name value pair can be specified. See page 534 in your SAMS book for more information.