If you are using the $.cookie jQuery plugin ...
var checkbox = $('#your-form :checkbox:first'), checkboxCookieName = 'checkbox-state'; checkbox.prop('checked', +$.cookie(checkboxCookieName)); checkbox.click(function() { $.cookie(checkboxCookieName, +this.checked); });
source share