I’d just use standard JavaScript.
There are probably some existing plugins for cookies / local storage available as well if it’s easier.