Paul's JavaScript cookie libraries

Cookies are small amounts of data stored by a web browser on a user's hard disk. They're the system most websites use for storing individual user names and preferences (see "A quick cookie primer" for more details). These function libraries make it easy to create, retrieve and update cookies from 'client side' JavaScript code running in browser pages.

The functions come in two forms:

Classic - a quick-and-easy way to transfer a single javascript variable (or value) to and from a cookie.

Object-based
- designed for handling multi-item cookies, with "field names" to avoid programming errors. I recommend using them even for single-item cookies, because they have a better programming interface, especially if you'll be reading and writing cookie data at various points in your code. 

Full details on using the libraries are in the Library descriptions pages (see left-hand menu). You can either copy the code from these pages, or download them as .js library files (links to them are on the pages, and in the Download page).  The example pages show the cookie libraries in action.

NOTE - these functions are (c) Paul Stephens 2001-2003. They are provided on a strictly "as is" basis. They may be freely copied and distributed, but not resold, either alone or as part of any other package, without my permission.  There is no charge for their use, and I make no warranty whatsoever concerning their quality or fitness for purpose. I advise you to test all applications thoroughly before live use.