Super Tiny Cookie Handling Plugin with jQuery - Zebra_Cookie

Super Tiny Cookie Handling Plugin with jQuery - Zebra_Cookie
File Size: 69.9 KB
Views Total: 472
Last Update:
Publish Date:
Official Website: Go to website
License: MIT

Zebra_Cookie is a super tiny plugin that allows you easily and quickly to set, write, read and remove cookies in jQuery.

You might also like:

How to use it:

1. Include the latest jquery library on your page

<script src=""></script>

2. Include zebra_cookie.js after jquery

<script type="text/javascript" src="zebra_cookie.js"></script>

3. Usage

// inside the DOM-ready function
// a "cookie" object will be available in jQuery’s namespace
// the object exposes 3 methods that you can use to write, read and delete cookies
$(document).ready(function() {
    // create a session cookie (expires when the browser closes)
    $.cookie.write('cookie_name', 'cookie_value');
    // create a cookie that expires in 1 day
    $.cookie.write('cookie_name', 'cookie_value', 24 * 60 * 60);
    // read a cookie’s value
    // following the examples above, this should return "cookie_value"
    // the "read" method returns null if the cookie doesn’t exist
    // delete the cookie

This awesome jQuery plugin is developed by unknown. For more Advanced Usages, please check the demo page or visit the official website.