I am using jquery.cookie.js from https://github.com/carhartl/jquery-cookie
please let know if anything im missing or understanding wrongly
$.cookie('cartQuantity', 3, { expires: 180 , path : '/' });
alert( $.cookie('cartQuantity') ); //alerts 3
$.cookie('cartQuantity', null);
alert( $.cookie('cartQuantity') );//alerts 3
You have to remove the cookie passing the same options that you have used for the creation:
There’s also the
$.removeCookiemethod which was very recently added to the plugin (2 months ago), so if you are using a version that supports it, you could use it instead.