Chapter 8. Handling Cookies

Topics in This Chapter

  • Understanding the benefits and drawbacks of cookies

  • Sending outgoing cookies

  • Receiving incoming cookies

  • Tracking repeat visitors

  • Specifying cookie attributes

  • Differentiating between session cookies and persistent cookies

  • Simplifying cookie usage with utility classes

  • Modifying cookie values

  • Remembering user preferences

Cookies are small bits of textual information that a Web server sends to a browser and that the browser later returns unchanged when visiting the same Web site or domain. By letting the server read information it sent the client previously, the site can provide visitors with a number of conveniences such as presenting the site the way the visitor previously customized it or letting identifiable visitors in without their having to reenter a password.

This chapter discusses how to explicitly set and read cookies from within servlets, and the next chapter shows how to use the servlet session tracking API (which can use cookies behind the scenes) to keep track of users as they move around to different pages within your site.



Core Servlets and JavaServer Pages (Vol. 1.Core Technologies)
Core Servlets and Javaserver Pages: Core Technologies, Vol. 1 (2nd Edition)
ISBN: 0130092290
EAN: 2147483647
Year: 2002
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net