sdz-cookie-vue

0.1.3 • Public • Published

SDZ Cookie Vue

  • Vue 2
  • Nuxt 2

npm:

$ npm install sdz-cookie-vue --save

yarn:

$ yarn install sdz-cookie-vue

Vue 2 Install

// main.js
import Vue from 'vue';
import VueCookieSession from 'sdz-vue-cookie';

Vue.use(VueCookieSession, {
  name: '__cookieName',
  maxAge: 60 * 60 * 24 * 30,
  sameSite: 'lax',
  secrets: ['s3cr3ts']
});

Nuxt 2 Install

// plugins/cookie.js
import Vue from 'vue';
import VueCookieSession from 'sdz-vue-cookie';

export default ({ app }, inject) => {
  Vue.use(VueCookieSession, {
    name: '__cookieName',
    maxAge: 60 * 60 * 24 * 30,
    sameSite: 'lax',
    secrets: ['s3cr3ts']
  });
};
// nuxt.config.js
export default {
  plugins: [
    { src: '~/plugins/cookie.js', mode: 'client' }
  ],
};

Dependents (0)

Package Sidebar

Install

npm i sdz-cookie-vue

Weekly Downloads

8

Version

0.1.3

License

MIT

Unpacked Size

7.27 kB

Total Files

8

Last publish

Collaborators

  • sdzpaulopanissa