Questions tagged [express-session]

Simple session middleware for Express

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

1209 questions
6
votes
2 answers

express.session won't set cookie on iOS Safari when accessing application through it's domain

I have a Node/Express application hosted on Heroku that has a domain that I purchased for it. When using the application on my desktop it works fine. I can log-in just fine when I visit it's domain at https://myapp.app or where it's hosted at on…
6
votes
2 answers

Ordering of Express JS Middleware

I was messing around with Express JS and was the using express-session. It didn't work if I didn't put the app.use(session()) middleware first app.use(session({ name: 'server-session-cookie-id', secret: 'my express secret', …
kydCoco
  • 127
  • 1
  • 7
6
votes
0 answers

Trouble setting cookies with Express.JS + Nginx

I am in the middle of decoupling my frontend from my backend repo. In doing so I am hosting my server on a personal Raspberry Pi 3 on my home network. My frontend is hosted by Netlify. I have run into a problem where I am not able to set cookies on…
user3079061
  • 229
  • 4
  • 12
6
votes
2 answers

express session not saving for Ipad

I am trying to save a session variable for a user when they login. This works on the computer, but when I try it on an iPad using Safari or Chrome it doesn't save. Here is where I set up my session: app.set('trust proxy', 1) app.use(session({ …
BStill
  • 894
  • 1
  • 9
  • 33
6
votes
5 answers

Express-session not persistent after redirect

Yesterday, I tried to make a website, using Node.js and the framework Express.js. On this website, the user needs to log, with credentials, who are checked in database. If the credentials are correct, I want to save the user's informations in a…
Yan Buatois
  • 61
  • 1
  • 3
6
votes
2 answers

Where is the express-session cookie hidden?

My express-session is working, I tested it with a very short cookie max-age (10 secs) and it works as intended: app.use(session({ secret: 'xxx', resave: false, saveUninitialized: true, cookie: { secure: true, maxAge: 10000 } })); The…
low_rents
  • 4,481
  • 3
  • 27
  • 55
6
votes
3 answers

How to use subscriptions-transport-ws with passport and express-session

I'm using a passport local strategy that works well with express: passport.use(localStrategy); passport.serializeUser((user, done) => done(null, JSON.stringify(user))); passport.deserializeUser((obj, done) => done(null,…
6
votes
3 answers

Why passport-twitter requires session support

I'm working on facebook, google, github, twitter authentication with passport. Authentication with facebook, google, github are executing how in tutorial was written. Only twitter back me message: 500 Internal Server Error: OAuth authentication…
6
votes
1 answer

Why is express session cookie being blocked as a third party cookie

I am using the express-session module, it works perfectly on localhost but on my website (hosted on Heroku using Cloudflare), the express session is being blocked as being a third party cookie. Here is the configuration for my session:…
Dan
  • 2,647
  • 2
  • 27
  • 37
6
votes
0 answers

express-session rolling not working

I've seen lots of questions about this, but none of the answers has solved my issue. I'm using express-session and I want the users session to remain alive as long as the user makes a request before the coookie MaxAge expires, hence I'm using the…
Daniel Flippance
  • 7,734
  • 5
  • 42
  • 55
6
votes
0 answers

Cant set cookie with Express Session/Passport and REACT

I cant understand how i can set cookie (connect sid) in REACT from my back-end. I have a Passport Local Strategy Here is my server.js app.use(cookieParser()); app.use(session({ resave: true, saveUninitialized: false, secret: 'bla bla bla', …
kikiwie
  • 390
  • 1
  • 3
  • 12
6
votes
3 answers

Node Express can't set session with post request

I use node express 4.0 to implement a message code verify function. I use session to store the msg code I send. I set up the session middleware as dos said: app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ …
Jack Zhang
  • 2,534
  • 5
  • 25
  • 34
5
votes
1 answer

Cookie is not get saved in chrome even after setting sameSite:'none' and secure: true for a MERN stack web app

After the latest updates in chrome, the browser is not saving my server cookies. Previously, it was working even it showed a warning about it. But now it is not. Since my react app is hosted on netlify and my server runs on AWS, it is cross-origin.…
Prayag k
  • 647
  • 9
  • 23
5
votes
0 answers

Node Express-Session & React Frontend not storing Cookie with Axios

Fellow web developer here. I seem to be running into this problem (that didn't occur until recently) where the cookie Session ID gets changed on every API request. Edit Confirms to work in IE11 & Edge!? Not Chome?! WTF! Doesn't work with fetch and…
Whatty
  • 79
  • 2
  • 5
5
votes
1 answer

Including bearer token in every request and keeping the user logged

I have an API running in a certain server, when you send a successful request to the login endpoint, it provides you with a JSONWEBTOKEN. On my second server, I'm running a website which is sending the requests to the API. What I want is to save…
Ser
  • 103
  • 1
  • 1
  • 7