"Initialise" doesn't necessarily mean "create", rather it means "prepare for use". If the cookie didn't previously exist, then yes, it would be created too. Every time you call a Jookie function, pass in an indentifier to determine which cookie to read from or modify.
// initialise a cookie that lives for 60 minutes $.Jookie.Initialise("myCookieName", 60); // initialise a cookie that lives for the length of the browser session $.Jookie.Initialise("myOtherCookieName", -1);
Hopefully this bit is really straightforward. Because the data is stringified when saved and parsed when retrieved, values "get" from Jookie will be the same as when the were "set".
// retrieve a value from the cookie $.Jookie.Get("myCookieName", "myVariableName"); // set a value to the cookie $.Jookie.Set("myCookieName", "myVariableName", "My Example Value"); // delete a single value within the cookie $.Jookie.Unset("myCookieName", "myVariableName");
I'm guessing you're spotting a pattern by now...
I've added a simple "Debug" function which pops up an
alert() box with the cookie's contents and some information about it.