Reading a Cookie
Once you've set a cookie, you'll need to retrieve it in order to do anything useful. The last example set the cookie with the text string "Tom". The very simple Scripts 10.3 and 10.4 show you how to get that value from the cookie and display it on the screen (of course, you normally would not show off your cookies; this script just displays the cookie as an example).
Script 10.4. This short script reads a previously set cookie and sends it to the document window.
To read a cookie: