How to use the cookiejs.set function in cookiejs

To help you get started, we’ve selected a few cookiejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kktjs / kkt-ssr / example / react-router+rematch / src / store / index.js View on Github external
middleware: () => next => async (action) => {
          if (typeof window !== 'undefined') {
            const token = cookie.get('token');
            if (token) {
              await cookie.set('token', token, 1);
            }
          }
          // do something here
          return next(action);
        },
      },

cookiejs

A simple, lightweight JavaScript API for handling browser cookies.

MIT
Latest version published 12 months ago

Package Health Score

61 / 100
Full package analysis

Popular cookiejs functions