Questions tagged [express-session]

Simple session middleware for Express

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

937 questions
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,557
  • 6
  • 22
  • 39
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
  • 3,664
  • 10
  • 42
  • 78
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
  • 8
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
  • 213
  • 1
  • 13
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
  • 129
  • 1
  • 13
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,445
  • 3
  • 20
  • 29
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
  • 447
  • 6
  • 18
0
votes
3 answers

express-session didn't store session

Here I used the express-session to store user session but only to find that the req.session.user always undefined. It's funny that when I used chrome plugin postman to visit, there's no problem. so how to fix it ? var session =…
zhoushx3
  • 101
  • 1
  • 6
0
votes
0 answers

javascript understanding cookies indepth

In my frontend react application, I am trying to check if a session cookie exists, as this will help me decide whether to show a login page (if no session cookie exists or invalidated), or show content page. The backend express-session middleware…
0
votes
1 answer

express-session is not saving user's session data

express-session is refusing to save the session data for my users. It is saving the session cookie, but the data is not persisting. Here is my server.js.
robbie
  • 1,075
  • 1
  • 10
  • 18
0
votes
0 answers

handling session variables inside http.request in express

Hi. When i print the req.session.mySessValue in UI , the value is empty. I think the assigning of req.session.mySessValue = dt.myValue; (express-session) is not proper.…
Nizam
  • 67
  • 8
0
votes
1 answer

' undefined is not a function' Error on app.use session in NHibernate, mongo store

I have a database in mongo to store session state called 'SessionStore' with a collection called 'Sessions' to store session state. I'm using expression-session for managing sessions. Code to setup sessions is as follows; var session =…
Paul S Chapman
  • 686
  • 7
  • 32
0
votes
0 answers

Monitoring session views for a chrome extension?

I currently have a chrome extension that GET's javascript from my node.js server. However the javascript file I want to serve will depend on the number of times https://www.google.co.uk/ has been visited. I want to perform this on the server side,…
0
votes
1 answer

Creating session within monk's findOne command

This simple bit of code illustrates the problem: The second session does not save. How can I make this work? router.post('/users/login', function (req, res) { var db = req.usersDb; var users = db.get('users'); req.session.test = "This works"; …
user788055
0
votes
1 answer

express-session creates new cookies for each request

So I'm building an app with angular on the front and nodejs/express on the backend. My problem is that when using express-session, each request creates a new session cookie. I have searched through a lot of questions and answers but it seems that…
LosGlennos
  • 99
  • 10