The below checkbox uses Cookie to save the last selected state. The cookie will expire in a year.
Checkbox
Remix