|
Despite the jargony jingle, maintaining state is a
process in which we engage daily in our own lives, from building
a ham and turkey triple-decker sandwich to reading a book.
In fact, a simple analogy is the humble bookmark. That
little card we stick inside an evening's reading material
maintains the "state" of the book -- that is,
where we left off. Similarly, to assemble a sandwich one
must retrieve a series of ingredients, all the while remembering
which ingredients have already been retrieved. This, too,
is a way of maintaining state -- tracking a state of
affairs over the course of several steps. Talk of sandwiches
aside, this article will focus on techniques for maintaining
state across Web pages, thus allowing the Web site to
"remember" information across a series of steps.
Such techniques are commonly used in "remembering"
user preferences or the popular shopping cart mechanisms
used on retail Web sites. As the third installment in the
Perl You Need to Know series, this article will
of course assume a basic familiarity with
Perl, as well as
using the
CGI module, as covered in
parts 1 and 2 of
this series.
|