Skip to content

Instantly share code, notes, and snippets.

@bishoymelek-zz
Created March 16, 2018 21:24
Show Gist options
  • Save bishoymelek-zz/5a665ba92a780ee029c31b84f3c85100 to your computer and use it in GitHub Desktop.
Save bishoymelek-zz/5a665ba92a780ee029c31b84f3c85100 to your computer and use it in GitHub Desktop.
a snippet to use in your expressJS app if it keep logging you out while reloading the app in the development
var connect = require('connect');
var cookieParser = require('cookie-parser');
var cookieSession = require('cookie-session')
app.use(connect()).use(cookieParser());
app.use(cookieSession({
name: 'session',
keys: ['key1', 'key2'],
// Cookie Options
maxAge: 24 * 60 * 60 * 1000 // 24 hours
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment