Section 25.150. HTMLDocument.cookie: the cookie(s) of the document


25.150. HTMLDocument.cookie: the cookie(s) of the document

DOM Level 0

25.150.1. Synopsis

 String cookie 

25.150.2. Description

cookie is a string property that allows you to read, create, modify, and delete the cookie or cookies that apply to the current document. A cookie is a small amount of named data stored by the web browser. It gives web browsers a "memory" so they can use data input on one page in another page or recall user preferences across web browsing sessions. Cookie data is automatically transmitted between web browser and web server when appropriate so server-side scripts can read and write cookie values. Client-side JavaScript code can also read and write cookies with this property.

The HTMLDocument.cookie property does not behave like a normal read/write property. You may both read and write the value of HTMLDocument.cookie, but the value you read from this property is, in general, not the same as the value you write. For details on the use of this particularly complex property, see Chapter 19.

25.150.3. Usage

Cookies are intended for infrequent storage of small amounts of data. They are not intended as a general-purpose communication or programming mechanism, so use them in moderation. Note that web browsers are not required to retain the value of more than 20 cookies per web server, nor to retain a cookie name/value pair of more than 4 KB in length.

25.150.4. See Also

Chapter 19




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

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