Are cookie read/write atomic in browser

前端 未结 3 813
孤独总比滥情好
孤独总比滥情好 2020-12-31 04:30

I am trying to implement a cross tab mutex for my needs. I found a implementation here. which seems quite promising. Basically, it implements Leslie Lamport\'s algorithm

3条回答
  •  清酒与你
    2020-12-31 05:22

    No. Even if the browsers probably implement a read and a write lock on the cookie it won't protect you from changes that happens between a read and a consequent write. This is easy to see by looking at the javascript API for cookies, there is no mutex functionality there...

提交回复
热议问题