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

Chapter 3. Advanced DHTML Techniques > Storing Data in Cookies

Storing Data in Cookies

Unlike the previous two methods for storing data, where once the browser window closes the data is lost for good, using cookies allows you to place a copy of the data in a small text file on the visitor’s computer. This is a powerful feature, but browsers provide powerful safety features to make sure it is not abused. For the designer’s part, we can use cookies not only to pass data between Web pages, but to store data even after the visitor has quit the browser altogether.

Before you get to the actual process of using cookies to store data, though, you first need to set up a library of commonly used functions not only to read, write, and delete cookies, but also to create dates based on how many days, hours, and minutes in the future you want your cookie to expire.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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