Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger an action when document.cookie changes?

I need to update localStorage when document.cookie changes. Is there any way to set a listener, overwrite a prototype to act as middleware or some other pattern that would result in the ability to trigger a function on change? I'm trying to avoid something like polling on an interval.

Thanks for any ideas.

like image 822
fancy Avatar asked Feb 21 '12 08:02

fancy


1 Answers

Theres no avoiding it, these events simply dont exist, you'll need to poll.

like image 65
smassey Avatar answered Sep 29 '22 05:09

smassey