Fork me on GitHub
1. Creating session cookies.

A session cookie expires when the browser is closed.
Run this example and check the browser's console.

                    // create a session cookie
                    $.cookie.write('Zebra_Cookie_Example1', 'Hello, I am Example1');

                    // print cookie values to the console
                    console.log($.cookie.read('Zebra_Cookie_Example1'));
                    

2. Creating cookies with an expiration time

The expiration time must be set in seconds.
Run this example and check the browser's console.

                    // create a cookie that expires in 1 day)
                    $.cookie.write('Zebra_Cookie_Example2', 'Hello, I am Example2', 24 * 60 * 60);

                    // print cookie values to the console
                    console.log($.cookie.read('Zebra_Cookie_Example2'));
                    

3. Reading cookie value

$.cookie.read returns null if the read cookie is not set.
Run this example and check the browser's console.

                    // read the value of the cookies set in example 1 and 2
                    var example1 = $.cookie.read('Zebra_Cookie_Example1');
                    var example2 = $.cookie.read('Zebra_Cookie_Example2');

                    // if example 1 has been run
                    if (example1) console.log('Value of cookie from example 1 is: "' + example1 + '"');

                    // if example 1 has not yet been run
                    else console.log('"Zebra_Cookie_Example1" does not exist');

                    // if example 2 has been run
                    if (example2) console.log('Value of cookie from example 2 is: "' + example2 + '"');

                    // if example 2 has not yet been run
                    else console.log('"Zebra_Cookie_Example2" does not exist');
                    

4. Deleting cookies

Run this example and check the browser's console.

                    // delete cookie from example 1
                    $.cookie.destroy('Zebra_Cookie_Example1');

                    // print cookie values to the console
                    console.log($.cookie.read('Zebra_Cookie_Example1'));