# Async Cookie Store API, 크롬 87부터 사용 가능

> Clean Markdown view of GeekNews topic #3058. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3058](https://news.hada.io/topic?id=3058)
- GeekNews Markdown: [https://news.hada.io/topic/3058.md](https://news.hada.io/topic/3058.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2020-10-20T09:49:34+09:00
- Updated: 2020-10-20T09:49:34+09:00
- Original source: [medium.com](https://medium.com/nmc-techblog/introducing-the-async-cookie-store-api-89cbecf401f)
- Points: 6
- Comments: 0

## Topic Body

- 올드한 방식의 document.cookie 를 대체

- Promise를 리턴해서 Service Worker에서도 사용 가능

- 쿠키별 직접 접근, 루프를 통해 찾을 필요 없음

- 이벤트 리스너를 등록하여 쿠키 변경 모니터링

ㅤ→ await cookieStore.get('session_id')

ㅤ→ await cookieStore.set({ name: 'opt_out', value: '1' });

ㅤ→ await cookieStore.delete('session_id');

ㅤ→ cookieStore.subscribeToChanges([{ name: 'session_id' }])

## Comments



_No public comments on this page._
