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

What's Next

In this chapter, you learned how to implement various approaches to storing state information. You saw how to use HTML hidden form fields to pass state information from one page to the next. This approach had the advantage of relying on a standardized language (HTML) that is well supported by all browsers, but it suffered from the drawback of being high maintenance because it falls to you to build the hidden fields into every single page. It also requires you to progress from every page to the next page by means of a form submission—something that may not always be desirable or feasible.

Next, you saw how to place state information by means of cookies using the <cfcookie> tag. You learned that, depending on whether you specify expiration information, the cookie may or may not be written to disk when the browser shuts down. A cookie with no expiration information is called a session or memory cookie because it is stored only in the browser's memory and is eliminated when the browser shuts down. Cookies with expiration information are written to text files on the user's hard drive when the browser is shut down. When the browser is restarted at some later time, the cookies stored in the text files are retrieved and brought back into the browser's memory. Cookies are simple to implement from the developer's perspective and are not a high-maintenance way to store state information like hidden form fields are. However, users can disallow cookies on their browsers, meaning that you may not be able to store state information for those users.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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