Socket
Book a DemoInstallSign in
Socket

@types/cookies

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cookies

TypeScript definitions for cookies

0.9.1
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version published
Weekly downloads
2.4M
-0.26%
Maintainers
1
Weekly downloads
 
Created

What is @types/cookies?

The @types/cookies package provides TypeScript type definitions for the 'cookies' npm package, which is used for handling browser cookies in Node.js applications. These type definitions allow TypeScript developers to use the 'cookies' package with type safety, ensuring that the methods and properties used are correctly typed according to the expected inputs and outputs.

What are @types/cookies's main functionalities?

Get Cookie

Retrieve the value of a cookie named 'LastVisit'. This feature is useful for accessing user-specific data stored in cookies, such as session tokens or user preferences.

import Cookies from 'cookies';
const cookies = new Cookies(req, res);
const lastVisit = cookies.get('LastVisit');

Set Cookie

Set a new cookie on the client's browser. This example sets a cookie named 'name' with the value 'value', and marks it as HTTP-only and secure, which are important flags for protecting cookies.

import Cookies from 'cookies';
const cookies = new Cookies(req, res);
cookies.set('name', 'value', { httpOnly: true, secure: true });

Other packages similar to @types/cookies

FAQs

Package last updated on 07 Jun 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.