
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ffsm/cookie
Advanced tools
npm i @ffsm/cookie
OR
yarn add @ffsm/cookie
import { Cookie } from '@ffsm/cookie';
const cookie = Cookie.from(initialize);
const staticGet = Cookie.get('access_token', {}, initialize);
const staticGetAll = Cookie.getAll({}, initialize);
const all = cookie.getAll({});
const accessToken = cookie.get('access_token', {});
cookie.set('name', 'value', {
// options
});
initialize is used to detect cookies. By default, if initialize is falsy, it will be set to the document of the browser if on the client side context.
'use server';
import { cookies } from 'next/headers';
import { Cookie } from '@ffsm/cookie';
export async function loader() {
const initialize = await cookies();
const cookie = Cookie.from(initialize);
const accessToken = cookie.get('access_token', {})?.value;
// Others code
}
import { useEffect } from 'react';
import { Cookie } from '@ffsm/cookie';
export default function App() {
useEffect(() => {
const accessToken = Cookie.get('access_token', {})?.value;
console.log(accessToken);
}, []);
return <div>App</div>;
}
export default function HomePage() {
return <div>Home page</div>;
}
HomePage.getInitialProps = (ctx) => {
const cookie = Cookie.from(ctx);
const accessToken = cookie.get('access_token', {})?.value;
return {
accessToken,
};
};
export interface ParseOptions {
decode?: boolean | ((value: string) => string);
}
export interface CookieOptions {
expires?: string | number | Date;
path?: string;
domain?: string;
secure?: boolean;
httpOnly?: boolean;
sameSite?: 'strict' | 'lax' | 'none';
encode?: boolean | ((value: string) => string);
priority?: 'low' | 'medium' | 'high';
maxAge?: number;
partitioned?: boolean;
baseDomain?: boolean;
}
export interface CookieSerialized extends CookieOptions {
name: string;
value: string;
}
class Cookie {
static DEFAULT_OPTIONS: CookieOptions = {
expires: 7,
path: '/',
secure: true,
httpOnly: true,
sameSite: 'strict',
};
}
Finding case and update more 🤥
FAQs
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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.