Created
March 16, 2018 21:24
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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