Questions tagged [express-session]

Simple session middleware for Express

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

1209 questions
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,219
  • 1
  • 11
  • 25
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
  • 9
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
  • 832
  • 10
  • 37
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
0
votes
2 answers

node.js - Can't figure out how to sabe sessions with session-express

I'm new to node.js and sessions, I'm trying to store some values in the node.js session, but everytime I reload the page and check the console.log the session haven't been saved. My code: var session; var org; function checkSession(argument){ var…
Pablo
  • 510
  • 8
  • 22
0
votes
1 answer

Automatically remove mongodb document after period of inactivity

I need to remove mongodb documents after a specified period of not being accessed. I have a access token I use to retrieve data from an external source and save it in my database. In my session I store a user id I can use the retrieve the access…
jalbasri
  • 328
  • 2
  • 13
0
votes
0 answers

Update EJS Layout with Session

My ejs layout provides the current user's username on the main menu through sessions <% if (typeof currentUser === 'undefined'){%> <% } else { %>
0
votes
1 answer

express-session, read vars on socket.io interaction

I am making a chat for customers of a web page, with express.js, and socket.io, and I'm trying to manage sessions with express-session, my problem is, how do I read the session values on the socket. Here's part of my code. Thanks for the help :) var…
0
votes
2 answers

Express session inside callback comes back undefined outside

I have a route written in Express as the following: app.get("/route", function(req, res){ if (someBoolean){ someFunction(stuff, function(user){ ... req.session.user = user; }); } …
alibman
  • 33
  • 6
0
votes
0 answers

Having difficulties with session variables persisting across requests

My application is currently being opened from my file system and makes requests to a server hosted on cloud 9. Whenever I submit information from the same page I make two requests from the same page. One request is to create a new resource and the…
Alan
  • 1,134
  • 2
  • 13
  • 25
0
votes
0 answers

NodeJS + ExpressJS User Login

I am currently working on a web application that requires an user login snippet. I have built an API for getting user information and others. But I cannot let NodeJS work with sessions. So, I have an API endpoint like this for logging in:…
Ali Demirci
  • 5,302
  • 7
  • 39
  • 66