listing 10.2 writing a cookie