worker-dom
worker-dom copied to clipboard
cookie support
A (sadly) very common pattern for user auth is to rely on cookies for state. As a result, sites need to be able to know up to the moment information about the cookie store, that may be modified in other browser windows (ie multitab). Many major websites need to be aware of cookie jar modifications in other windows (either by rapidly polling document.cookie for changes, or via the Cookie Store API. amp-script/worker dom introduce some really exciting opportunities for component reuse, but in order for that to be possible to many of these authors, we would need to provide a cookie interface, and one that isn’t just a snapshot of the cookie jar on hydration
(This is a follow up to a conversation at ampconf- cc @kristoferbaxter @nainar )
+1 vote for the feature. We really really need it.
Plan of attack:
- Leverage Cookie Store API.
- Create a Polyfill that's lazily loaded and configurable with a different polling interval.
I'd love to see this happen, especially as we're considering making this possible in traditional AMP components in https://github.com/ampproject/amphtml/issues/25670.
@kristoferbaxter wdyt?
This would be great, additionally it would be nice if it could be scoped so we don't need to worry about cross app cookie overlap