Cookie personalization example: a Movie Review Channel

So with our knowledge of cookies, we will tackle a typical example of a personalized channel. We will also need to draw on some information about forms, which are covered in detail in Managing Channel Form Submissions.

Suppose you were creating The Movie Review Channel, a (fictional) channel that provides new DVD, video, and theater reviews daily. It tends to be a lot of information and the reviews can be pretty long-winded. So it would be nice if you could prescreen them and only present the ones the user is interested in. Maybe your reader is into action flicks. Or comedies. And maybe the idea of seeing a family-oriented kiddie film makes him break out in a rash.

What you would like is the ability for any user to customize his movie preferences through a form submission. He could go to a form, select the movie genres he prefers, and the next time he synchronizes, he would be presented with a list of movies that fit into one of those genres.


Design concept: user ID in cookie, the rest in a database
Keeping page requests in sync with preferences
Implementation details for this example
Setting up the databases
Listing 1: frontpage.pl
Listing 2: editprefsform.pl
Listing 3: setprefs.pl