Universal cookie plugin for Nuxt.js with SSR [JavaScript/TypeScript]


cookie-universal-nuxt is a libary for using cookie in Nuxt.js.
You can use cookie-universal-nuxt to set, get and remove cookies in both client and server side Nuxt.js apps.

🐮 Installation

yarn add cookie-universal-nuxt

🎃 Configuration

{
modules: ["cookie-universal-nuxt"];
}

🎂 How to use

Set

this.$cookies.set("cookie-name", "cookie-value", {
path: "/",
maxAge: 60 * 60 * 24 * 7
});

Get

const cookieRes = this.$cookies.get("cookie-name");

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!