🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

express-secure-cookie

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-secure-cookie

An opinionated replacement for express' `res.cookie` method

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

An opinionated replacement for express' res.cookie method.

Automatically detects whether to set secure flag dependent on request protocol. Defaults httpOnly to true.

Install

npm install express-secure-cookie

Usage

var app = require('express')();

app.use(require('express-secure-cookie'));

app.get('*', function (req, res) {
    res.cookie('foo', 'bar');
    // this cookie will now have its `secure` flag set appropriately for
    // the protocol of the inbound request - i.e. http/s
    // the cookie will also have its `httpOnly` flag set to true meaning
    // it cannot be read by `document.cookies`
});

...

app.listen(8080);

Keywords

express

FAQs

Package last updated on 23 Mar 2015

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