JavaScript Cookie Store API
Sources:
Overview
Code Snippet Metadata:
- Date:: 2024-04-12
- Source: **
- Language: JavaScript
- Description:: ""
Code Snippet
WARNING
This feature is available only inĀ secure contextsĀ (HTTPS), in some or all supporting browsers.
The API also has functions to manage cookies:
[cookieStore.delete](https://developer.mozilla.org/en-US/docs/Web/API/CookieStore/delete)
: to delete a cookie,[cookieStore.get](https://developer.mozilla.org/en-US/docs/Web/API/CookieStore/get)
: to get info on a single cookie,[cookieStore.set](https://developer.mozilla.org/en-US/docs/Web/API/CookieStore/set)
: to set a single cookieās info.
Details
In the past, developers usedĀ document.cookie
Ā to get cookie information. But it has its limits, like not showing the domain, path, or expiration details.
However, developers could use dev tools for more details. Now, theĀ Cookie Store APIĀ gives access to those detailed cookie attributes, just like dev tools. But it canāt reach cookies with the HttpOnly
attribute.
See Also
- JavaScript Map of Content
- JavaScript Code
- Hyper Text Markup Language (HTML)
- Cascading Style Sheets (CSS)
- React.js
- Next.js
Appendix
Note created on 2024-04-12 and last modified on 2024-04-12.
Backlinks
(c) No Clocks, LLC | 2024