Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@advanced-rest-client/cookie-parser
Advanced tools
Changelog
3.2.0 (2020-05-23)
Readme
A JavaScript cookie parser for HTTP clients. Works in the browser as ES6 module or in NodeJS.
import { Cookies } from '@advanced-rest-client/cookie-parser';
const parser = new Cookies('rememberme=1; domain=foo.com; path=/; ssid=Hy1t5e#oj21.876aak;', 'http://bar.com/');
console.log(parser.cookies);
In Node:
const {Cookies} = require('@advanced-rest-client/cookie-parser');
const parser = new Cookies('rememberme=1; domain=foo.com; path=/; ssid=Hy1t5e#oj21.876aak;', 'http://bar.com/');
console.log(parser.cookies);
npm install --save @advanced-rest-client/cookie-parser
It parses set-cookie
header received from the server and produces a Cookie object.
import { Cookies } from '@advanced-rest-client/cookie-parser';
const parser = new Cookies('rememberme=1; domain=foo.com; path=/; ssid=Hy1t5e#oj21.876aak;', 'http://bar.com/');
console.log(parser.cookies);
which is equivalent to:
const cookies = Cookies.parse('...');
The filter function filters out cookies that should not be considered for given URL. This is defined in https://tools.ietf.org/html/rfc6265.
const instance = new Cookies('a=b; domain=foo.com; path=/;', 'http://sub.foo.com/');
const removed = instance.filter();
console.log(removed); // has the cookies because domain does not match
To clear expired cookies just call clearExpired()
function.
const instance = new Cookies('a=b; expires=0;', 'http://sub.foo.com/');
// wait a second here, then
const removed = instance.filter();
console.log(removed); // the cookie expired
git clone https://github.com/advanced-rest-client/cookie-parser
cd cookie-parser
npm install
npm start
npm test
FAQs
A javascript cookie parser for javascript HTTP clients.
The npm package @advanced-rest-client/cookie-parser receives a total of 9 weekly downloads. As such, @advanced-rest-client/cookie-parser popularity was classified as not popular.
We found that @advanced-rest-client/cookie-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.