Availability
JavaScript 1.0
Synopsis
document.cookieDescription
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 CGI scripts on the server end can read and write
cookie values. Client-side JavaScript code can also read and write
cookies with this property.
The Document.cookie property does not behave like
a normal read/write property. You may both read and write the value
of Document.cookie, but the value you read from
this property is, in general, not the same as the value you write.
For complete details on the use of this particularly complex
property, see Chapter 16.
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 (for the entire server, not just for your site on the
server), nor to retain a cookie
name/value pair
of more than 4 KB in length.
See Also
Chapter 16
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.