For the new readers out there, welcome; and for those of you who read the first article in this three-part series, welcome back! This month, we’ll be taking a first look at cookies—the most popular method of creating persistent data on the Web without using a CGI script. If that last sentence didn’t make any sense to you, you might want to go back and read Part 1, where I explain all the basic concepts you’ll need.
Cookies, for the purposes of this article, are best thought of as a persistent form of the JavaScript variable. Introduced in Netscape Navigator 2.0, they are supported by just about any Web browser that supports JavaScript. As a result, cookies are a reliable, well-supported means of creating persistent data on your Web pages.
This article will assume that you are comfortable with the basics of HTML. A passing familiarity with JavaScript will definitely come in handy, but as in my past articles I’ll make an effort to explain everything from the ground up. If at any time you feel lost, I’ve provided links to several places where you can improve your grounding in these concepts at the end of this article.