New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@monvechen/cookie-manager

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monvechen/cookie-manager

for manager cookies

latest
Source
npmnpm
Version
1.0.18
Version published
Maintainers
1
Created
Source

for manager cookies

state

refer to https://github.com/juji/cookie-manager

Usage

CookieManager
import { CookieManager } from "@monvechen/cookie-manager"

const cm = new CookieManager();

cm.store( 
 [
  'cna=111; Expires=someDate; domain=.example.com; path=/; secure',
  'name=222; Expires=someDate; domain=.example.com; path=/; HttpOnly'
   'cannel=333; Expires=someDate; domain=www.example.com; path=/; HttpOnly'
 ],
 'https://example.com/test/path'
);

const cookies = cm.prepare( 'http://example.com' );
// 'cna=111; name=222'

const arr = cm.exportOriginStrArr()
//[
//  'cna=111; Expires=someDate; domain=.example.com; path=/; secure',
//  'name=222; Expires=someDate; domain=.example.com; path=/; HttpOnly'
//  'cannel=333; Expires=someDate; domain=www.example.com; path=/; HttpOnly'
// ]

//clear all
cm.reset()
cookieTool
import { cookieTool } from "@monvechen/cookie-manager"

cookieTool.parse('cna=111; Expires=someDate; domain=.example.com; path=/; secure')
//{name:'cna',value:'111',expires:'someDate', path:'/', secure:true}

cookieTool.stringify({name:'cna',value:'111',expires:'someDate', path:'/', secure:true})
//'cna=111; Expires=someDate; domain=.example.com; path=/; secure'

cookieTool.tokenize(
  [
    {name:'cna',value:'111',expires:'someDate', path:'/', secure:true},
    {name:'cannel',value:'222',expires:'someDate', path:'/', secure:true}
  ]
)
//'cna=111; cannel=222'

//clear all
cm.reset()

Keywords

cookie

FAQs

Package last updated on 05 May 2022

Did you know?

Socket

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