• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 23. Cookies and Creating Your Ow... > Self-Modifying Pages That Respond to...

Self-Modifying Pages That Respond to Cookie Data

Here’s another cookie example. This time, you’ll see two different pages depending on whether a cookie was set. The page will modify itself to ask the user for his name if the cookie was not set, and will display a welcome message using his name if the cookie containing that name was set.

Here’s how it works. We’ll start by checking whether the cookie, which I’ll call name1, is set, and if so, write a welcoming message to our web page using that name:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint