tiny-cookie.js - Cookie handling for tinyJS

tiny-cookie.js integrates a Cookie-function t.c into tiny.js, which reads and sets Cookies.

Download

tiny-cookie.js [899b] - tiny-cookie-min.js.gz [268b]

Hint

The t.c-function requires only tiny.js. Other scripts are not necessary.

Usage

If the name of a cookie is given as argument to t.c(), its value is returned. If otherwise a Cookie-Object is given as argument, the corresponding Cookie is set.

Cookie-Object

Das Cookie-Object has the following format:

{
    name:[name:String*], 
    value:[value:String*], 
    date:[date:Date|Int(ms)], 
    path:[path:String], 
    domain:[domain:String],
    extra:[extra:String, beginning with "; "]
} 

Example

t.c({name:'test', value:'right', date:1000});
t.c('test')==='right'