Class CookieStoreManager
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The CookieStoreManager interface of the {{domxref("Cookie Store API", "", "", "nocode")}} allows service workers to subscribe to cookie change events. Call Subscribe(List<CookieStoreGetOptions>) on a particular service worker registration to receive change events.
[Value("CookieStoreManager")]
public class CookieStoreManager
- Inheritance
-
CookieStoreManager
- Inherited Members
Remarks
A CookieStoreManager has an associated ServiceWorkerRegistration. Each service worker registration has a cookie change subscription list, which is a list of cookie change subscriptions each containing a name and URL. The methods in this interface allow the service worker to add and remove subscriptions from this list, and to get a list of all subscriptions.
To get a CookieStoreManager, call Cookies.
Constructors
CookieStoreManager()
public CookieStoreManager()
Methods
GetSubscriptions()
The getSubscriptions() method of the CookieStoreManager interface returns a list of all the cookie change subscriptions for this ServiceWorkerRegistration.
[Value("getSubscriptions")]
public Task<List<CookieStoreGetOptions>> GetSubscriptions()
Returns
- Task<List<CookieStoreGetOptions>>
A Promise that resolves with a list of objects, each containing:
Remarks
Subscribe(List<CookieStoreGetOptions>)
The subscribe() method of the CookieStoreManager interface subscribes a ServiceWorkerRegistration to cookie change events.
[Value("subscribe")]
public Task<GlobalObject.Undefined> Subscribe(List<CookieStoreGetOptions> subscriptions)
Parameters
subscriptionsList<CookieStoreGetOptions>
Returns
- Task<GlobalObject.Undefined>
A Promise that resolves with GlobalObject.Undefined when the subscription completes.
Remarks
Unsubscribe(List<CookieStoreGetOptions>)
The unsubscribe() method of the CookieStoreManager interface stops the ServiceWorkerRegistration from receiving previously subscribed events.
[Value("unsubscribe")]
public Task<GlobalObject.Undefined> Unsubscribe(List<CookieStoreGetOptions> subscriptions)
Parameters
subscriptionsList<CookieStoreGetOptions>
Returns
- Task<GlobalObject.Undefined>
A Promise that resolves with GlobalObject.Undefined when the service worker has been unsubscribed.