[ Team LiB ] Previous Section Next Section

Hour 19. Saving State with Cookies and Query Strings

What You'll Learn in This Hour:

  • What cookies are and how they work

  • How to read a cookie

  • How to set a cookie

  • How to use cookies to store site usage information in a database

  • About query strings

  • How to build a function to turn an associative array into a query string

HTTP is a stateless protocol. Therefore, every page a user downloads from your server represents a separate connection. On the other hand, Web sites are perceived by users and publishers alike as environments, as spaces within which a single page is part of a wider whole. It's not surprising, therefore, that strategies to pass information from page to page are as old as the Web itself.

In this hour, we will examine two methods of storing information on one page that can then be accessed on subsequent pages.

    [ Team LiB ] Previous Section Next Section