express-session

express-session not saving nodejs

依然范特西╮ 提交于 2020-08-10 06:50:30
问题 This simple example is not working. In every request the session is created again, I don't know how to solve it. var express = require('express'), expressSession = require('express-session'), app = express(); app.use(expressSession({ secret:'secret', resave:true, saveUninitialized:true, cookie:{ httpOnly:false, expires:false } })); app.all('/',function(req,res,next){ var session = req.session; if(session.count){ session.count++; } else{ session.count = 1; } console.log('id:',req.sessionID);

express-session not saving nodejs

≯℡__Kan透↙ 提交于 2020-08-10 06:50:30
问题 This simple example is not working. In every request the session is created again, I don't know how to solve it. var express = require('express'), expressSession = require('express-session'), app = express(); app.use(expressSession({ secret:'secret', resave:true, saveUninitialized:true, cookie:{ httpOnly:false, expires:false } })); app.all('/',function(req,res,next){ var session = req.session; if(session.count){ session.count++; } else{ session.count = 1; } console.log('id:',req.sessionID);

session handling in expressjs with router

China☆狼群 提交于 2020-08-10 04:35:52
问题 I'm using expressJS, and I'm a bit confused about sessions. I have 1 single expressJS server, which is reachable from different URLs. Depending on where the connection is coming frmo (which URL is opened), a different database is used to provide the responses. And I can see that the sessions are conflicting. My assumption is that I should be setting different cookie names, based on the URL of the request, but it seems I can't specify a function within the session config. Any ideas? var app =

express-session secure: true

我的梦境 提交于 2020-07-06 13:45:56
问题 app.use(session({ secret: "testing credentials", store: sessionStore, resave: true, saveUninitialized: true, cookie : { httpOnly: true, //secure: true, maxAge : 60 * 60 * 1000 } })); I'm working on some security problems on my newly developed website. And after done some research online, if secure=true is set, then it will be more secure. However, If set secure: true, then information inside session will lose every time when the user send another request. Is there a way to solve this problem?

express-session secure: true

三世轮回 提交于 2020-07-06 13:44:26
问题 app.use(session({ secret: "testing credentials", store: sessionStore, resave: true, saveUninitialized: true, cookie : { httpOnly: true, //secure: true, maxAge : 60 * 60 * 1000 } })); I'm working on some security problems on my newly developed website. And after done some research online, if secure=true is set, then it will be more secure. However, If set secure: true, then information inside session will lose every time when the user send another request. Is there a way to solve this problem?