Skip to content

Instantly share code, notes, and snippets.

View frankhn's full-sized avatar
🎗️
Ready!💫

frankhn frankhn

🎗️
Ready!💫
View GitHub Profile
@frankhn
frankhn / nodejs-express-cookies-example.js
Created December 16, 2019 13:38 — forked from gdm85/nodejs-express-cookies-example.js
How to create session cookies with Node.js + Express
var express = require('express'),
app = express(),
https = require('https'),
fs = require('fs'),
keys = require( "keygrip" )(['secret1', 'secret2']),
cookies = require( "cookies" );
// This line is from the Node.js HTTPS documentation
var options = {
key: fs.readFileSync('private_key_cert.pem'),