# vue-cli-plugin-cookie

> 🍪 Vue CLI 3/4 Plugin for handling browser cookies

Latest version **0.1.0** (published 2020-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-cli-plugin-cookie
pnpm add vue-cli-plugin-cookie
yarn add vue-cli-plugin-cookie
bun add vue-cli-plugin-cookie
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-08-23 |
| First published | 2020-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | BattlefieldDuck |
| Maintainers | battlefieldduck |
| Keywords | vue, vue3, cli, cookie, cookies, vue-cookie, vue-cookies, vue-cli-plugin, vue-cli-4, vue-cli4 |

## Links

- npm: https://www.npmjs.com/package/vue-cli-plugin-cookie
- Repository: https://github.com/BattlefieldDuck/vue-cli-plugin-cookie
- Homepage: https://github.com/BattlefieldDuck/vue-cli-plugin-cookie#readme
- Issues: https://github.com/BattlefieldDuck/vue-cli-plugin-cookie/issues
- npm.io page: https://npm.io/package/vue-cli-plugin-cookie

## Dependencies (1)

- [tiny-cookie](https://npm.io/package/tiny-cookie.md) ^1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-08-23
- 0.0.4 — 2020-08-22
- 0.0.3 — 2020-08-22
- 0.0.1 — 2020-08-22

## README

# vue-cli-plugin-cookie
🍪 Vue CLI 3/4 Plugin for handling browser cookies

### Install

add the cookie plugin with vue-cli or vue-cli UI. `import` and `.use()` will be added to main.js automatically
```sh
vue add cookie
```

### Example Usage

##### Get a cookie
```js
this.$cookie.get('jwt_token')
```

##### Set a cookie
```js
this.$cookie.set('jwt_token', 'cookie_data')
this.$cookie.set('jwt_token', 'cookie_data', { sameSite: 'Lax', expires: '1Y' }) // set SameSite to Lax, Expires to 1 year
this.$cookie.set('jwt_token', 'One year', { expires: '1Y' })
this.$cookie.set('jwt_token', 'One month', { expires: '1M' })
this.$cookie.set('jwt_token', 'One day', { expires: '1D' })
this.$cookie.set('jwt_token', 'One hour', { expires: '1h' })
this.$cookie.set('jwt_token', 'One minutes', { expires: '1m' })
this.$cookie.set('jwt_token', 'One seconds', { expires: '1s' })
```

##### Remove a cookie on the current domain
```js
this.$cookie.remove('jwt_token')
this.$cookie.delete('jwt_token') // alias of remove
this.$cookie.remove('jwt_token', { domain: 'parentdomain.com' }) // remove the parent domain's cookie
```

##### Get all cookies
```js
this.$cookie.getAll()
```

---
_Source: https://npm.io/package/vue-cli-plugin-cookie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
