Get started with js-cookie CDN

MIT licensed

Js-Cookie is a small and easy-to-use library for working with HTTP Cookies in JS.

Tags:
  • cookie
  • cookies
  • browser
  • amd
  • commonjs
  • client
  • js-cookie
  • browserify

Stable version

Copied!

How to start using js-cookie CDN


// Include the library in your HTML file
<script src="https://cdn.cdnhub.io/js-cookie/3.0.5/js.cookie.min.js"></script>

// Set a cookie
jsCookie.set('username', 'JohnDoe', { expires: 30 }); // expires in 30 days

// Get a cookie
const username = jsCookie.get('username');
console.log(username); // Output: 'JohnDoe'

// Delete a cookie
jsCookie.delete('username');
Copied!
Copied!
Copied!
Copied!

All versions