Skip to content

Instantly share code, notes, and snippets.

@Muhammed-Rahif
Last active April 27, 2021 04:27
Show Gist options
  • Save Muhammed-Rahif/db3b5b5b925795269bb2f944df14237f to your computer and use it in GitHub Desktop.
Save Muhammed-Rahif/db3b5b5b925795269bb2f944df14237f to your computer and use it in GitHub Desktop.
var express = require('express');
// Import of express-session
var session = require('express-session');
// Configure
app.use(session({secret:"Key",cookie:{maxAge:600000}}))
// Usage
app.use("./",(req,res) => {
req.session.YOUR_KEY = YOUR_VALUE
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment