Questions tagged [express-session]

Simple session middleware for Express

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

1209 questions
0
votes
0 answers

Node Express Session revocation on re-issue?

Using node v12, Express 4, and connect-pg-simple During our security evaluation is was discovered that if a user logs in successfully, and logs in again successfully, that the prior session remains valid. I'd like for the second login to revoke the…
user9170
  • 950
  • 9
  • 18
0
votes
0 answers

Express session secret - from client to server?

I am using express-session with Express 4. I am confused about how I pass the secret from the client to the server. I assume that I need to pass the secret for every request, otherwise I don't really understand what the secret is for. var session =…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Sending XmlHttpRequest with session (again)

I have a page and I want to track what the current user is doing. For this, the server gives him an id, and than, I'd like to send a XmlHttpRequest to log information, and I'd like to keep its id. However, the request received by my server as an…
tforgione
  • 1,234
  • 15
  • 29
0
votes
1 answer

Node.js: Why not saved session?

Here's the code: app.get('/vklogin', function(request, response) { console.log('Авторизация через соц.сеть "Вконтакте"'.green); var url_parts = url.parse(request.url, true); var query = url_parts.query; var data = querystring.stringify({ …
Octoloper
  • 205
  • 2
  • 9
0
votes
0 answers

Express Session Getting Overwritten

I have Express with Passport authentication and have added session to it as below. app.use(cookieParser()); // read cookies (needed for auth) app.use(bodyParser()); // get information from html forms app.set('view engine', 'ejs'); // set up ejs for…
skumar
  • 41
  • 6
0
votes
2 answers

How to redirect to last action in sailsjs using req.session?

I am creating a login application where I need to redirect back to previous url from where the login action was called. I need to know does sails provide a built-in method by using which I can redirect to previous action without creating my own…
Rohit Choudhary
  • 2,253
  • 1
  • 23
  • 34
-1
votes
1 answer

Do i need to install express-session every time I use passport nodejs?

Do i need to install express-session every time I use passport nodejs? I was following a tutorial on using Oauth (Google) with Passport.js and Nodejs, The Net Ninja one And He didn't mention express-session and it worked for him When I tried it it…
-1
votes
2 answers

req.session.userId returning undefinded

I am working on a simple Todo web application, and I am stuck in authorisation. I want to protect all my routes by having an active user session. When doing an API call to a POST route, I keep getting undefined for req.session.userId within the…
Nežumi
  • 61
  • 1
  • 7
-1
votes
2 answers

Why i am getting the UnhandledPromiseRejectionWarning: TypeError: Cannot read property '_id' of undefined error?

I have intigrated the sslcommerz payment gateway but when I am completing my transaction successfully, instead of redirecting me in the dashboard page, it is throwing the following error: UnhandledPromiseRejectionWarning: TypeError: Cannot read…
-1
votes
2 answers

Difference between Token based and Session based Authentication

So, I've implemented some form of auth on my API, I'm not sure which kind it classifies as. What my app does is, it generates a token once a user signs up/logs in and then before every endpoint call, I have a middleware function that checks if a…
user13387446
-1
votes
1 answer

Use express-session with NextJS

I'm in the middle of making a login system, with nextJS, and Mysql. I wanted to use sessions to login the user, but don't know how to combine express-session with NextJS. My question is, can express-session be used with NextJS, if so how?
Hef
  • 606
  • 6
  • 16
-1
votes
2 answers

req.session.user get undefined whenever i change anything on my server, and on the first i make a call from the frontend, then works well

my code works but whenever i made a change in the server.js, the req.session.user turns undefined. This also happens the first time i make a request from the front, i do get authenticate. but right after i dont get the user.name and cookie cause it…
-1
votes
1 answer

how do i fix cannot read property of 'save' of undefined

I'm trying to save a session when I log in but, when I try to sign in I get the error TypeError: Cannot read property 'save' of undefined. I am using express-session's req.session.save({}) method when I get the error. what is wrong with my code and…
Ben
  • 1
  • 2
-1
votes
1 answer

Using apollo-server-express, express-session and socketio - Cors issue present when socketio tries to connect on the client side

I am trying to use apollo-server-express to maintain a graphql endpoint and other endpoints to perform oAuth with twitter. I wanted to perform the oauth in the client in a way that a browser tab opens and a socket transmits a "MESSAGE" (as an…
-1
votes
1 answer

Express session not saving / persisting

I'm not sure what I did wrong Last project before this was fine, session is saving / persisting Stack: MEAN Node version: v14.15.0 Express version: v4.17.1 Express session version: v1.17.2 app.ts // ... _session: typeof expressSession =…
1 2 3
80
81