Socket
Socket
Sign inDemoInstall

@firstandthird/cookie-monster

Package Overview
Dependencies
0
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @firstandthird/cookie-monster

Cookie manager


Version published
Weekly downloads
45
increased by45.16%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

Build Status npm

Cookie manager

Installation

npm install @firstandthird/cookie-monster

Usage

import CookieMonster from '@firstandthird/cookie-monster';

const name = 'cookiename'; // required
const value = 'somevalue'; // required - may also be an object
const expires = 10; // optional - Days cookie is valid
const path = '/test'; // optional - defaults to /
const domain = 'blog.example.com'; // optional
const isSecure = false; // optional - sets secure flag
const sameSite = 'Strict'; // optional - defaults to 'Strict' - Valid values: 'None', 'Lax', 'Strict'

// Set cookie
CookieMonster.set(name, value, expires, path, domain, isSecure, sameSite);

// Get cookie
CookieMonster.get(name);

// Remove cookie

CookieMonster.remove(name);

// Increment a counter cookie
CookieMonster.increment(name, expires);

// Decrement a counter cookie

CookieMonster.decrement(name, expires);

Methods can also be imported as needed:

import { get, remove } from '@firstandthird/cookie-monster';

get(name);

remove(name);

Keywords

FAQs

Last updated on 27 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc