Questions tagged [express-session]

Simple session middleware for Express

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

1209 questions
3
votes
1 answer

Verification using express-mysql-session

As I'm new to node programming, I have started to make a dummy web site and I want to implement session management using the existing library express-mysql-session. I went through the documentation of this package. I have followed the given steps…
Rohan Gaur
  • 55
  • 8
3
votes
1 answer

How to test express-session type sessions in nodejs using postman?

I have a nodejs backend with sessions made using express-session npm module. I want to test the sessions using postman. What I want is a user should be allowed to access the users list via the /getUsers route only if he is currently in a session.…
logdev
  • 292
  • 6
  • 22
3
votes
2 answers

Express Session cookies not being saved in Chrome?

I have an express session set up to use cookies which get stored in a database. This works perfectly in firefox, but it chrome it doesn't seem to ever save the cookie, so the session is never reflected by the client. app.use(expressSession({ …
stackers
  • 2,701
  • 4
  • 34
  • 66
3
votes
1 answer

Could not obtain grant code: Error: self signed certificate in certificate chain

I'm trying to access protected by Keycloak url - /hello in the browser. The url is served by the node.js app This error is thrown by the following code: after the following sequence of actions: 1) adding client and user to keycloak to KeyCloak…
rok
  • 9,403
  • 17
  • 70
  • 126
3
votes
1 answer

Node js with local-passport Logout not working

I really don't know why the Post Request and the following redirect and Rendering is not working. Here my Code: HTML: $(function () { $LogOutButton.click(function () { $.ajax({ type: "POST", url: "/logout" …
3
votes
2 answers

Express Session Not Persisting Between Requests

I'm having problems with express-session. Session data is not persisting between requests. As you can see in the code below the /join route sets some session properties, but when the /surveys route is hit the session data is not available.…
BugHunterUK
  • 8,346
  • 16
  • 65
  • 121
3
votes
1 answer

Express Session : terminate session on tab/browser close

I need to terminate the user session or log user out when they close the browser or tab. Following is the code implemented to maintain session: app.use(session({ store: new RedisStore({ url: REDIS_CONNECTION_URL, }), secret:…
Sujit
  • 59
  • 1
  • 3
3
votes
1 answer

Firebase hosting with rewrite to function doesn't set session cookie

I'm using nodejs express app with express-session and firebase. Firebase hosting configured to be redirected to Firebase functions. I'm trying to store some data in the session. It works perfectly if I access the app via function url. However,…
3
votes
2 answers

nodejs - heroku - express-sessions

i'm building a website in nodejs with expressjs and i'm using express-sessions for handling the users sessions. here is my code. on app.js file from where the app starts. app.use(express.static(path.join(__dirname,…
user2487076
  • 73
  • 5
  • 10
3
votes
1 answer

express-session get all sessions

I use Node.js express and express-session I want to get all session or find session by sessionID in express-session I had sessionID and want to find it I want to check if user still logged in by check expires time
selfclose
  • 121
  • 3
  • 13
3
votes
1 answer

Every time React sends request to Express, a new session is generated

I use React as a client to send request to Express with proxy and express-session set up. But every time React makes a request to Express server, a new session is created. So I checked Express alone by manually accessing to the same api url and it…
James H.
  • 471
  • 8
  • 17
3
votes
1 answer

Variable added to Node.js express-session is undefined in next request

I am implementing a simple login functionality and storing the data in the express-session but not able to get it back. In loginDb.js file in login function i am storing the userId in session variable and in getLoginStatus function i am trying to…
Makarand Patil
  • 1,001
  • 1
  • 8
  • 15
3
votes
1 answer

Getting "TypeError: Secret string must be provided." in NodeJS application with Passport.js and Express-Session as middleware

Can someone explain to me where the middleware is requiring a secret string? Also, if I set a secret key/value pair in the passport.session options I am still getting the same error message This is the code // using pug since a view engine is…
3
votes
0 answers

NodeJs Session, Work in Postman but not in browser

I have some problems with the express session where I cannot retrieve my session variable that I had stored previously. Below are parts of my codes that I had written. server.js let express = require('express'), path = require('path'), …
TSL
  • 23
  • 1
  • 5
3
votes
1 answer

NodeJS: session variables shared for all clients (express-session)

I'm using express-session for handling session variables in a NodeJS Application. I use session variables for handling login-authorization, for saving logged user information and other things. The thing is that this session variables are being…
Oscar Martínez
  • 65
  • 1
  • 2
  • 9