Listen to an event in cookies

1

I'm developing an application to be used on two browser tabs. Eventually a tab modifies a cookie, so I need to refresh the other tab to load the correct information. Is it possible to hide a change in a cookie so that I can refresh the other tab?

Other suggestions are welcome.

    
asked by anonymous 07.12.2017 / 15:04

1 answer

1

No, it is not possible. There is no native API for this. And in general it is bad practice to rely on communication between tabs.

If you need to notice changes in cookies, you may be able to use setInterval to read cookies from time to time. So you can see if there were changes and make a decision about what to do based on that.

    
07.12.2017 / 15:13