Kitto
    Preparing search index...

    Module cookie

    2.2.0

    A lightweight, easy-to-use cookie management module for client-side JavaScript. This module provides functions for getting, setting, and removing cookies, as well as utilities for working with JSON data and checking browser cookie support.

    import cookie from 'kitto';

    // Set a cookie
    cookie.set('user', { id: 123, name: 'John' }, { expires: 7 });

    // Get a cookie
    const user = cookie.get('user', true); // true to parse JSON

    // Remove a cookie
    cookie.remove('user');

    // Check if cookies are enabled
    if (cookie.is_enabled()) {
    console.log('Cookies are supported and enabled');
    }

    Variables