JavaScript and Cookies

A cookie is a small bit of organized information that is stored in a text file on the user's computer by a browser. Cookies are typically used to store information pertinent to a specific site that is currently used and can be reused in the future.

The location of a cookie text file differs according to the browser being used. In Navigator, all cookies are stored in a file named cookies.txt. In Internet Explorer, each cookie is stored as its own individual text file in the Cookies folder, which is located by default in the Windows folder.

There are limitations to cookies. The size of a cookie is limited to 4KB kilobytes. Also, browsers only allow for 300 total cookies to be stored on the user's computer. This keeps the ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.