https://github.com/muhammetsafak/jscookie
Dom JS Cookie Manager
https://github.com/muhammetsafak/jscookie
Last synced: 2 months ago
JSON representation
Dom JS Cookie Manager
- Host: GitHub
- URL: https://github.com/muhammetsafak/jscookie
- Owner: muhammetsafak
- Created: 2023-02-12T04:53:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-12T04:53:47.000Z (over 2 years ago)
- Last Synced: 2025-01-26T03:24:11.970Z (4 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jsCookie
I have prepared a simple class that makes cookie management easier with JavaScript.
## Installation
Get the `jsCookie.min.js` file from this repo and include it in your HTML file. That is all.
```html
```
### Has
```js
jsCookie.has(name);
```__Parameters :__
- `name` : Cookie Name__Returned :__ `boolean`
### Get
```js
jsCookie.get(name, defaultValue = null);
```__Parameters :__
- `name` : Cookie Name
- `defaultValue` : Value to return if no cookie__Returned :__ It returns the cookie value or the specified default value.
### Set
```js
jsCookie.set(name, value, ttl = 8600, path = '/');
```__Parameters :__
- `name` : Cookie Name
- `value` : Cookie Value
- `ttl` : Life Time in Seconds
- `path` : Cookie Path__Returned :__ `boolean`
### All
```js
jsCookie.all();
```__Returned :__ `Array`