Using this simple plugin for jQuery, you can read and write cookie values.
From the docs:
Set the value of a cookie:
$.cookie('the_cookie', 'the_value');
Create a cookie with all available options:
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: True });
Create a session cookie:
$.cookie('the_cookie', 'the_value');
Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain used when the cookie was set.
$.cookie('the_cookie', null);
From the docs:
Set the value of a cookie:
$.cookie('the_cookie', 'the_value');
Create a cookie with all available options:
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: True });
Create a session cookie:
$.cookie('the_cookie', 'the_value');
Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain used when the cookie was set.
$.cookie('the_cookie', null);