Questions tagged [express-session]

Simple session middleware for Express

The express-session module is a simple session middleware for Express.

1209 questions
0
votes
1 answer

Expiration object in express-session not the correct type?

Every so often, my nodejs application — which uses the express v4.12.2 and express-session v1.13.0 modules — throws the following TypeError exception and crashes: /app/node_modules/express-session/node_modules/cookie/index.js:136 if (opt.expires)…
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
0
votes
0 answers

express-session has different results based on browser. Why?

I'm reading https://www.npmjs.com/package/express-session and am in a world of confusion. The store I'm using is https://www.npmjs.com/package/express-mysql-session var options = { host: 'localhost', user: 'root', password: 'somepass', …
zafrani
  • 4,030
  • 5
  • 31
  • 39
0
votes
1 answer

Object method in Express-Session

Currently I'm trying to link an object with an express session. There is my code : var express = require('express'); var session = require('express-session'); // I have an object named "engine", which is a fake SQL Object connection (for…
Aethyn
  • 695
  • 1
  • 4
  • 16
0
votes
1 answer

express-session: send extra detail in 401 response

I am using express-session and was wondering if its possible to send some additional details in the 401 response express will send back when a session is no longer found. I would like to distinguish when a session has expired vs when no session is…
mindparse
  • 6,115
  • 27
  • 90
  • 191
0
votes
1 answer

Express-session with passport.js multiple cookies

I'm trying to implement the login functionality with passport.js and express-session, it works well, var passport = require('passport'), session = require('express-session'), MongoDBStore = require('connect-mongodb-session')(session); var…
Anton Egorov
  • 1,328
  • 1
  • 16
  • 33
0
votes
1 answer

express-session and connect-mongo setup

I'm using express-session and am now wanting to use connect-mongo to persistently store session. I have seen the docs and some tutorials and mostly understand how it works, but I assume you need a mongoDB instance setup in the first place so…
mindparse
  • 6,115
  • 27
  • 90
  • 191
0
votes
1 answer

stormpath express-session logout not deleting session

I'm using stormpath-express along with express-session in my express application. The login part works fine. However, when I log out, the previous session property still there in the session. I can see the session property connect.sid remain the…
timpham
  • 556
  • 2
  • 7
  • 25
0
votes
0 answers

how to add express-session object?

I want to stack and pass over variables from a router to another and stack it so I chose express-session. Here is plan I designed. savinig req.body values to req.session.cAttr obj. move to next page and add other values(each views are connected) at…
Baroque Code
  • 134
  • 3
  • 15
0
votes
2 answers

is express-session possible to add as middleware so i don't have to add to each page

I want to log a user in and store there session so i can identify them. and then have some code on the back end that gets there data from and allows me to pass the username into another db method. i have the following, but want to use session…
f1wade
  • 2,877
  • 6
  • 27
  • 43
0
votes
0 answers

Nods.js Session works sporadically

In my node app I use 4 routes to get data and asynchronously when the data is received, I'm setting the session. I use express.js and expression-session npm. But setting the session works time to time. (sporadically setting the data) . Sometimes…
Amila Iddamalgoda
  • 4,166
  • 11
  • 46
  • 85
0
votes
1 answer

Express session not working just with IE

Running my third party js app, it has seen so weird when play with session on the IE . From here no problem using Chrome, FF and Safari. My apps has the following design: Any client can use my third party js code. So, this widget.js just does a call…
user1404404
  • 45
  • 1
  • 9
0
votes
1 answer

How to parse socket.io handshake cookie

I am using socket.io along with express sessions. I am using their middleware to get the cookie in the header, like: io.use(function(socket, next) { console.log(socket.handshake.headers.cookie); next(); }); which puts this to the…
Justin Levine
  • 265
  • 2
  • 16
0
votes
2 answers

redis string looks like a hash, getting the value

I am trying to access session data from node.js that is stored in redis. In the redis-cli I ran Keys * and returned 1) "sess:ZRhBJSVLjbNMc-qJptjiSjp8lQhXGGBb" 2) "sess:6p1EcGvJukTT26h88NqoTGdz2R4zr_7k" If I then run GET I get back what looks like a…
Simon245
  • 178
  • 2
  • 19
0
votes
1 answer

How to expose session variables to express views

I'm trying to access session variables in EJS views, but facing lots of problems. To access the req.session locally I'm using middleware as described here Accessing Express.js req or session from Jade template var express = require('express'); var…
Mahtab Alam
  • 1,810
  • 3
  • 23
  • 40
0
votes
2 answers

Req.session undefined with express 4 and Redis store, express-session

Can't seem to figure out how to use redis store for sessions with Express 4, some sample code looks like: var express = require('express'); var app = express(); var cookieParser = require('cookie-parser'); var bodyParser =…
Afs35mm
  • 549
  • 2
  • 8
  • 21