https://github.com/alt-javascript/cookies
Simple utility to ease the use of browser cookies
https://github.com/alt-javascript/cookies
Last synced: 2 months ago
JSON representation
Simple utility to ease the use of browser cookies
- Host: GitHub
- URL: https://github.com/alt-javascript/cookies
- Owner: alt-javascript
- License: mit
- Created: 2022-03-17T00:07:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-17T02:03:23.000Z (about 3 years ago)
- Last Synced: 2024-04-25T11:02:56.895Z (about 1 year ago)
- Language: JavaScript
- Size: 91.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
Simple utility to ease the use of browser cookies.
===================================[](https://nodei.co/npm/@alt-javascript/cookies/)


[release notes](https://github.com/alt-javascript/cookies/blob/main/History.md)Introduction
--------------------------------
Simple utility to ease the use of browser cookies.Usage
-------------------------The module is also able to be used directly in the browser, as an IIFE (Immediately Invoked Function Expression),
as follows:```html
cookies.setCookie('somecookie','giveitavalue',365,'Strict');// expires in 365 days, SameSite == Strict (default)
cookies.getCookie('somecookie');
cookies.deleteCookie('somecookie');
```Or import the ES6 module bundle from a module, as follows:
```javascript
import { Cookies } from 'https://cdn.jsdelivr.net/npm/@alt-javascript/cookies/dist/alt-javascript-cookies-esm.js'let cookies = new Cookies();
//...as above
```### Logger
The Cookies class optionally accepts an `@alt-javascript/logger`, an is configured with the `@alt-javascript/cookies/Cookies`
qualifier by default when using with `@alt-javascript/boot`License
-----------------------------May be freely distributed under the [MIT license](https://raw.githubusercontent.com/alt-javascript/cookies/main/LICENSE).
Copyright (c) 2021-2022 Craig Parravicini