Chapter 10: JavaScript and Cookies

Return to Chapter 10


To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Reading a Cookie

See it run: Reading a Cookie

Script 10.3

JavaScript uses the ID in this HTML page to insert the cookie result.

Script 10.4

This short JavaScript reads a previously set cookie and sends it to the document window.