
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
next-universal-cookie
Advanced tools
Provides way to read, set and delete a cookie for Next.js similar to
expresssuch as req.cookies, res.cookie and res.clearCookie
npm install next-universal-cookie
import {GetServerSideProps, NextPageContext} from 'next';
import {applyServerSideCookie} from 'next-universal-cookie';
export const getServerSideProps: GetServerSideProps = async ({req, res}) => {
applyServerSideCookie(req, res);
// Typescript-ready
// Parse all cookies
const allCookies = req.cookies;
// Set
res.cookie();
// Delete
res.clearCookie();
return {
props: {},
};
};
// pages/api/index.ts
import {NextApiRequest, NextApiResponse} from 'next';
import {applyApiCookie} from 'next-universal-cookie';
export default function handler(
req: NextApiRequest,
res: NextApiResponse<{ok: boolean}>
) {
applyApiCookie(req, res);
// Typescript-ready
const allCookies = req.cookies;
res.cookie();
res.clearCookie();
// Response
res.json({
ok: true,
});
}
import {applyServerSideCookie, applyApiCookie} from 'next-universal-cookie';
MIT
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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.