I'm using passport-discord and passport to allow users to authenticate using their discord accounts.
For some reason, cookies aren't being stored in the browser (on frontend website), I use axios (withCredentials set to true in request options) to…
Setup
Backend: Express.js, express-session, connect-mongo, cors, modules working in Node.js host from Heroku (Free edition), and storing data to MongoDB Atlas (cloud-based Mongo solution)
Frontend: React.js, axios, working in Godaddy shared linux…
Okay, simple problem, but I have no idea about how to approach it. I have an iframe that runs a server that uses express-session. However, the "connect.sid" cookie cannot save because the iframe and the parent site are cross-site. I would still like…
I built a middleware for session-based authentication with express-session package and as a session store I use the connect-mongo package.
When I run this Jest test:
//..
const createServer = require("./server") // <-- this line triggers the…
I put my node express server into production. In development, express-session worked fine (it stored session into cookies with MemoryStore). But now it creates a new session ID into MongoStore every time I refresh or make a request. Also, it doesn't…
There are similar questions out there, but not that directly address why this application of express-session consistently works in Safari but not in chrome.
My server code is below, which only needs to authenticate a single page with a logged out…
I have been trying to implement Single SignOn(SSO). I have different frontend application modules which are running on different domain and they all utlize a single API server.
SSO Server https://sso.app.com
API Server https://api.app.com
Frontend…
Problem:
Trying to set the cookie on login using express-session, but think I'm missing something obvious. The response to the login POST request includes Set-Cookie. I've also set the Access-Control-Allow-Origin and Access-Control-Allow-Headers to…
After successful login, userId and Name of the user are saved in a cookie.
server.js
const io = require('socket.io')(http)
const session = require('express-session')
const Allusers = [ {id: 1, name: 'Admin', username: 'admin', password: 'admin'}…
I see that it's almost standard today to use JWT for modern applications, where the API and the front-end are totally separated, and served from a different server.
I know that browsers will not send cookies to different domains by default, but…
Example if you run:
console.log('Connect.sid', req.headers.cookie);
Result of connect.sid value:
connect.sid=s%3A04x6YVZX68nRrhakd3SWuIMakDhuGptO.kyBVHe0HDI4pW1JeOl0xEopRYgQ51ZVlAKdfui7ii18
And if you log the req.sessionID the result is going to…
I have a basic node.js express app using express-sessions.
Please can someone help with why the sessions are not persisting and why a new session is created for every request.
The app itself is quite large so i have added a reduced case of the…
I work with app, that already has its own infrastructure. The task is to integrate session-cookie mechanism. I spent a lot of time to understand why cookies doesn’t set on client side.
I. Briefly.
App settings:
Server: NodeJS
Port: 8081
Client:…
I am building a MEAN stack chat application. And I want to be able to get express session id inside socket.io on connection handler. I am able to access the socket.handshake.session.id but it is not the same as req.session.id. Further…
I have a node.js (express, passport) application with rolling session authentication.
The application is simple enough, just login-password that returns the cookie for the session and a few API functions that are available only with…