Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

discord oauth2 login session persistence lost on mobile after redirect

I'm working on a Discord login integration for my app, and it's mostly working, but I'm running into an issue with authentication persistence. The login works fine on desktop — I'm redirected to ...
mosf's user avatar
  • 63
0 votes
0 answers
22 views

How to store session data in express properly

I have a 4.x express app. I would like to store data in the session after user has successfully logged in. When I try to access this data in another request the data is always undefined. Here is my ...
Jonas's user avatar
  • 41
1 vote
1 answer
21 views

saveUninitialized and resave in session (node js)

When to use saveUninitialized and resave in express-session ? I'm newbie for Mern stack and am trying to implement session management. where I came across "express-session", I found a common ...
Kiran raj B's user avatar
0 votes
0 answers
9 views

express js session not being maintained

I separated the front end back end and implemented it, but even if I run an api like the bottom, it is only saved in the session at the beginning and there is nothing in the session if I call it up ...
Leejuhyeon's user avatar
0 votes
0 answers
21 views

Express session expires after a post request from external URLs

I am trying to implement a bank payment system using the Express framework. According to the bank's docs, It starts by redirecting the user to a specific URL like this: res.redirect("https://pec....
asajadi84's user avatar
  • 559
0 votes
0 answers
46 views

Can't delete the session of another user in nodejs

I am using session based authentication for the first time. I have been reading and wathcing tutorials. I would like to know how to end the session of another user. I know that I can use this line of ...
valve's user avatar
  • 45
0 votes
0 answers
22 views

req.session not updated after saving them and sending an axios post request

so I am working on my login system, and if a user clicks a link which takes them to another page and their session has expired, it will simply get them to login again and after redirect to that page. ...
robinb's user avatar
  • 21
0 votes
0 answers
44 views

TypeScript Error: Property 'userId' does not exist on type 'Session & Partial<SessionData>'

I'm encountering a TypeScript compilation error related to session management in my Node.js application. Here is the error message I receive: D:\Web Dev\RAHI\Backend\node_modules\ts-node\src\index.ts:...
Ainz's user avatar
  • 71
0 votes
0 answers
17 views

Unable to save and access session data. Express server and Angular front end

I'm new to Express and Angular and this is my first time posting a question on SO. I'm working on an app in which I want to be able to maintain session data. Once a user is logged in I want to store ...
Killedet's user avatar
0 votes
0 answers
24 views

Cookie-session only works within the route I apply the data to

I am working on a project in express. I need to get certain fields from a login route into a session on the backend, so I can call the data from different routes. The problem is that when I try to ...
Charlie Infi's user avatar
0 votes
1 answer
33 views

How to share session cookie between a Koa app and Experss app?

I have an API built using Koa v2 and we have a cookie session based authentication. For that, we use the koa-session library and it works. But now, we are migrating our API to NestJS, using express as ...
Gustavo Mendonça's user avatar
0 votes
0 answers
27 views

Save session information in Postgres with cutom Session model for express

I want to use session for an express back-end authentication & authorization using express-session library. I also want to persist the session in Postgres with custom schema as defined in the ...
chala's user avatar
  • 21
0 votes
1 answer
42 views

Express session variable is undefined on other routes after defining it in the login route

I've seen this question be asked many times, but there is still no answer after I've gone through a dozen similar questions. The core of the problem is I have a node server with a mongodb database, ...
Kavin Bharathi's user avatar
0 votes
1 answer
58 views

How can I set up Express-Session cookies in Safari using two different Fly.io apps?

Host: fly.io Server: Node-Express Front-end: Vite-React I am using Fly.io for both the front-end and the server. I am using express-sessions for user auth. Safari will not save the session cookies in ...
Jonny Love's user avatar
0 votes
1 answer
36 views

Why does clearing all sessions make my NestJS app unresponsive?

I have a NestJS app, with a special Admin route I want to be able to call to clear out all user sessions (for example: after we deploy a new version of the application so we can kick everyone out). I ...
Chris Barr's user avatar
  • 33.8k
0 votes
0 answers
19 views

Session Cart Resets After First Product Addition in Express.js Application

I'm building an online store application using Express.js, and I'm having trouble with session persistence. The cart works fine the first time I add a product, but if I add another product or make any ...
Saleh Enab's user avatar
0 votes
1 answer
222 views

Session not persisting after redirect during Google OAuth 2.0 flow

I have been working on this bug for a while now, I can break it down in detail but can't solve it, so any help would be greatly appreciated. Currently Req.user and req.session are not persisting after ...
Drail's user avatar
  • 1
0 votes
1 answer
36 views

Deleted user remains logged in despite account deletion

I'm encountering an issue where users remain logged in even after their accounts have been deleted by an admin in my Express.js application using MongoDB for user data storage. When an admin deletes a ...
prajitha k's user avatar
0 votes
1 answer
47 views

What If Session Expires While User Is Still On The Website

Suppose that there are 5 minutes left for the session to expire when user enters the website.Every action that user will make after 5 minutes will be rejected by server if it requires you to login and ...
Tunahan Keklik's user avatar
0 votes
1 answer
41 views

Issue with back button navigation after login in Node.js Express using sessions and cookies

I've implemented a basic login system using session and cookies in Node.js Express. After successful login, users are redirected to /home to see a welcome page. However, when users click the browser's ...
prajitha k's user avatar
2 votes
0 answers
62 views

express-session not working in deployement but working in development

I worked on a MERN project and everything was going well in development(local) mode. When i hosted my code on vercel i noticed that session are not working properly. my mentor suggested to create a ...
Vishnu Shouryan Reddy Hanmandl's user avatar
0 votes
0 answers
47 views

req.session.userId returns undefined

Please guys come to my aid. I have battling this issue for weeks now. I am currently taking the Ben Awad Full-Stack course and I'm having trouble with the express-session part. Whenever I try to ...
Nzubechukwu Ukagha's user avatar
0 votes
0 answers
33 views

Express JS connect-flash requires manual additional page reload

My flash messages seem to require an additional manual reload of the page for them to appear. Here's an example of how I'm using it: if (password.length < 12) { req.flash('error', '...
Petter Thowsen's user avatar
1 vote
0 answers
18 views

passport serialize/deserialize user google login problem

why if a user logged in with google makes a post to secrets the req.user only includes the googleId but when its a normal user it contains all the object stored in the db im trying to use the objectId ...
brazilclouds's user avatar
0 votes
1 answer
210 views

Express-session store not deleting session when using req.session.destroy()

Using express-session and connect-mongodb for session based authentication (or trying to at least). I have a logout route that is calling req.session.destroy(), I have the unset property set to "...
Matthew DeFusco's user avatar
0 votes
0 answers
22 views

"Remember Me" functionality usng PassportJS with express-session and connect-redis not working on browser restart

passport.use( 'local', new LocalStrategy( strategyOptions, async ( req: Request, email: string, password: string, done: (error: any, user?: any, options?: ...
PirateApp's user avatar
  • 6,208
0 votes
0 answers
39 views

Session doesn't show value on changing routes

Express session doesn't show value on changing routes. Here in '/login' route it shows req.session.user data, but in '/connect' it shows req.session.user is undefined Here is the code import express ...
GayalMelappilly's user avatar
0 votes
0 answers
37 views

Session Cookie Not Persisting in Browser on Fetch/Axios Request with Express, Passport, and NextJs

I've been working on an authentication flow using Express, Passport, and Redis for session management on the backend, with a React (Next.js) frontend. The sessions are correctly created and stored in ...
Anas AitZouinet's user avatar
0 votes
1 answer
92 views

express-session issue with cookies

I am building an app using express.js and vue 3, and I am using session based auth, it is working great on local. However it is not working in production. here is my code for configuring the session ...
Khaled Nadam's user avatar
0 votes
0 answers
78 views

How to set cookie on localhost on developing environment currently?

I'm on a session authentication work with nextjs and express. I installed express-session and finished a session login function, tried on postman and it works fine. But when I call the login request ...
Carl.t_'s user avatar
  • 103
0 votes
0 answers
16 views

Cant handle Session's cookie when Safari/iOS

Browser cant send back the cookie when is safari/ios const corsOpt = { origin: ['mydomain.com', 'http://localhost:5173'], credentials: true, }; ... server.set('trust proxy', 1); server.use(cors(...
Steve Gkortsopoulos's user avatar
-1 votes
1 answer
23 views

Session custom property getting undefined when calling Node js API from Javascript fetch

I am developing a User Login Project where Apis are written in node js and express, UI part is written in HTML and Javascript. These both are two individual projects. When User logins, a fetch cal is ...
Revanth Sai's user avatar
0 votes
0 answers
40 views

I'm having problems with client-side session creation, the browser doesn't save the session ID

Context: In the API I am working with express-session in NodeJS to create the sessions, I am just testing, therefore the sessions are stored in memory on the API side, I am using two different domains ...
José Pedraza's user avatar
0 votes
0 answers
104 views

NodeJS Express session is working in localhost but not working in Linux live server

I am trying to adjust my NodeJS Express project to use a Session Timeout of 2 Hours. Default timeout is 10 Minutes as I have checked. Below I have attached my app.js and login.js files codings. While ...
Ashik Sp's user avatar
1 vote
1 answer
52 views

Session not properly being passed for login and authentication

I am trying to learn how sessions work. I know that in the server side, req.session.user = { id: 1, username: 'user1' }; is being read correctly but when I hit the endpoint /check-session req....
leon's user avatar
  • 181
0 votes
0 answers
17 views

Cookie is destroyed once I switch the page

My program logs in (in login.html) and the express session cookie is created. Once the page is switched to index.html, the cookie is lost. I am using the live port extension running of port 5500 ...
Hrant's user avatar
  • 1
3 votes
1 answer
205 views

Value saved to Express session is not present on later requests

My app is acting as an OAuth server for a 3rd party service which will be accessed through an in our app. The authentication process all happens behind the scenes without an intermediate screen for a ...
ipenguin67's user avatar
  • 1,639
0 votes
0 answers
22 views

Different route handlers unable to access req.session.isSupervisor value in react-express-mysql website

I am working on an auditing website with two user roles - supervisors and team members. The user logs in to the system using his unique user ID and password. Whether the user is a supervisor or not is ...
Anonymous's user avatar
1 vote
0 answers
41 views

Session Authentication Fails on Express Server After Google OAuth Login

I'm developing a MERN stack application with a React frontend hosted on Surge (https://thestudyapp.surge.sh) and an Express backend hosted on Render (https://study-app-server.onrender.com). I've ...
TedRed's user avatar
  • 127
0 votes
0 answers
31 views

res sessions not saving

Currently I have my applications hosted and am now tryingto get my request sessions to work. Once I hosted my websites I realized that after logging in with google oauth, a user was made in my ...
JayyRon's user avatar
0 votes
1 answer
81 views

Express Session manually assign session

Something I don't understand about the express session middleware is the reassignment of sessions. E.g. When someone opens my page for the first time, the middleware will create a fresh new session ...
GreenSaiko's user avatar
0 votes
0 answers
27 views

How do I go about session handling considering my approach?

I currently have a decent authentication logic in place which will verify credentials against the database document/entry. Once a login request has a successful response, I set a httpOnly cookie ...
iamgreenintro's user avatar
1 vote
0 answers
24 views

About the deserializeUser function not running in the passport library

I have an application that is currently being developed. The front end is running at localhost:3000 and the back end is running at localhost:4000. When I tried to log in, I successfully checked the ...
kmyz's user avatar
  • 19
1 vote
0 answers
97 views

express session undefined session problem

Friends, I have codes where I perform session operations with 'Express', 'express-session', 'ioredis' and 'connect-redis'. I can successfully register the user session. However, I want to write the ...
ahmet ilboga's user avatar
0 votes
0 answers
93 views

How to get express-session cookie on frontend in production with Railway express backend and Railway CRA frontend?

I have a create-react-app frontend and an expressjs backend api using express session cookies for session management. My application runs perfectly on localhost including the cookies being saved ...
Kieran King's user avatar
1 vote
0 answers
81 views

How to set first party session cookie on the browser from diffrent domain

I am using express-session on the backend. My client is in React. My backend and the front end are hosted in two separate domains. I am sending the session from the backend to my client using the set-...
Husnul Aman's user avatar
0 votes
0 answers
42 views

Flash message is not displaying on ejs template

I want to set an error message on ejs using flash. But my message is not displaying on the page. If I use the req.session.message, it's working perfectly. When an error occurs, I am redirecting it to ...
Ahammed Zulaikh's user avatar
0 votes
0 answers
12 views

middleware order confusion over an express application

I have these middlewares in the yelp app in this order (assuming order matters): app.set('view engine', 'ejs'); app.use(bodyParser.urlencoded({ extended: false })); app.use(methodOverride('_method')...
omar watad's user avatar
0 votes
0 answers
48 views

In a node.js + express application, use a proxy route as middleware for another proxy

I have a node.js app with an api-gateway that routes to several microservices. One of the microservices is the authentication microservice. I want to use the route auth/verifySession to check if the ...
Vaprus's user avatar
  • 1
0 votes
0 answers
44 views

SessionID changes after each request with express server

I am currently trying to code a simple login system with express. I have a login page that sends a request to my express server which creates a new session using express-session. After that on my main ...
Cric_Hammel's user avatar

1
2 3 4 5
28