FunctionsetCookie

  • 写入 cookie。

    Parameters

    • key: string

      cookie 名。

    • value: string | number | boolean

      cookie 值。

    • Optionaloptions: Readonly<ICookieSetterOptions>

      操作选项。

    Returns void

    import { setCookie } from '@just4/cookie';
    setCookie('test', 1, {
    domain: 'abc.com',
    path: '/',
    expires: '30 days'
    });