Java Reference
In-Depth Information
of the cookie. When you get the cookie value back using getCookieValue(), you just split it into its
constituent parts; however, you must remember the order you stored it in.
var cookieValues = getCookieValue(“UserDetails”);
cookieValues = cookieValues.split(“;”)
alert(“Name = “ + cookieValues[0]);
alert(“Age = “ + cookieValues[1]);
alert(“Last Visit = “ + cookieValues[2]);
Now you have acquired three pieces of information and still have 19 cookies left in the jar.
Cookie Security and IE6+
IE6 introduced a new security policy for cookies based on the P3P an initiative set up by the World Wide
Web Consortium (W3C), a web standards body that deals with not only cookies but HTML, XML, and var-
ious other browser standards. (You'll learn more about W3C in Chapter 13. Its web site is at www.w3.org
and http://www.w3.org/P3P/ and contains a host of information, though it's far from being an easy
read.) The general aim of P3P is to reassure users who are worried that cookies are being used to obtain
personal information about their browsing habits. In IE 6+ you can select Tools
Internet Options and
click the Privacy tab to see where you can set the level of privacy with regards to cookies (see Figure 11-14).
You have to strike a balance between setting it so high that no web site will work and so low that your
browsing habits and potentially personal data may be recorded.
Figure 11-14
Search WWH ::




Custom Search