Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
cookiestorage
Advanced tools
Browserify-compatible module to get and set cookies in the browser using Storage API
Manage document.cookie
using the Storage API.
NOTE: originally a fork of cookie-monster, itself a fork of cookie-cutter.
npm install cookiestorage
var cookieStorage = require('cookiestorage');
var cookie = cookieStorage(document);
Return a new cookie object with .getItem()
and .setItem()
operating on document
.
The provided document
should have a non-referentially transparent cookie
property
like the DOM's variant where assignment with optional path and expiry creates a
new cookie in the getter as a key=value pair.
If document is not provided, uses the global document
if it exists. Otherwise, creates a new plain object {cookie:''}
.
If given a string, uses { cookie: givenString }
.
Returns number of key/value pairs present in document.cookie
Returns the cookie value for key
.
Sets the cookie at key
to value
with additional options:
expires
: Will be parsed by new Date(expires)
which accepts String
formatted per RFC 2822 or ISO-8601, Number
of milliseconds since 1 January 1970 00:00:00 UTC (Unix Epoch), or literal Date
objects.domain
: see cookie documentationpath
: see cookie documentationsecure
: see cookie documentationReturns the key (name) of the nth key/value pair in document.cookie
. Order is dependent on browser implementation. May not be alphabetical, or even consistent. Use this with caution. (It is added solely for consistency with the Storage API.)
Removes the given key from document.cookie
.
Clears document.cookie
of all key/value pairs.
FAQs
Browserify-compatible module to get and set cookies in the browser using Storage API
The npm package cookiestorage receives a total of 50 weekly downloads. As such, cookiestorage popularity was classified as not popular.
We found that cookiestorage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.