node.js - Different sessionID after server restart express -
this question has answer here:
i've noticed noticed when restart express server, session id saved on browser updated new value. normal behavior? can configure?
these current express-session
options:
var sessionoptions = { secret: "secret_here", resave: false, saveuninitialized: true, cookie: { maxage: 86400000 } }
as stated in docs:
each session has unique id associated it.
you can override function generates id setting genid property.
app.use(session({ genid: function(req) { return genuuid() // use uuids session ids }, secret: 'keyboard cat' }))
Comments
Post a Comment