I am newbie with the MEAN stack. I read the express-session github doc but there are some options which are unclear to me. Those options are saveUninitialized and resave.
Can anyone please explain with examples what are the advatanges of using…
I need to know if my user is connected or not. For that I want to read the cookies that I set in the server side with express-session :
app.use(session({
secret: 'crypted key',
resave: false,
saveUninitialized: true,
cookie: {…
In a Chrome warning it says "Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use." How do I do this correctly using express-session?
app.use(
cors({
credentials: true,
origin:…
I currently have a React App (via create-react-app) and an Express server for my API calls. They are both running separately and have been working fine until I ran into this problem:
I'm also using express-session and passport for user…
I have the following code:
var express = require('express');
var cookieParser = require('cookie-parser');
var http = require('http')
var app = express();
app.use(cookieParser());
var session = require('express-session');
app.use(session({
…
Inspired by How to share sessions with Socket.IO 1.x and Express 4.x? i implemented socket authentication in some "clean" way where is no need to use cookie-parser and to read cookies from headers, but few items remain unclear to me. Example use…
TL;DR:
Can't succeed persisting session across multiple APIs call performed
between a Backbone App and Node.js Server with Express,
Express-Session and Express-Cors. Looks like session is reinitialized/lost
after every call.
Long version:…
it sets the cookie if I run the server locally, but when it is hosted online :
If secure=false, sameSite: 'none' then I get the following error
Cookie “connect.sid” will be soon rejected because it has the
“sameSite” attribute set to “none” or an…
The session middleware for Express provides several configurable options.
resave: 'Forces the session to be saved back to the session store, even if the session was never modified during the request.'
saveUninitialized: 'Forces a session that is…
I tried to use the standard session persistance with Redis in NodeJS:
var express = require('express');
var RedisStore = require('connect-redis')(express);
var app = module.exports = express.createServer();
//…
Basically i'm doing redirect from a.example.com to www.example.com and i expect to be able to delete cookies on www.example.com (because cookie is created with .example.com as the cookie domain), but following code doesn't work.
I know that this…
here is a simple connection to use express session store, it keeps banging out this error even though the text is right from the book. I am pretty sure is has something to do with 'new MongoStore' object initialization.
var express =…
By now (10.7.2016) express-session's github-page suggests two mongodb session stores:
connect-mongo | A MongoDB-based session store - Github (775 Stars)
connect-mongodb-session | Lightweight MongoDB-based session store built and maintained by…
when I write this:
import { Request } from 'express-serve-static-core';
router.post((req: Request, res, next) => {
req.session.user = user;
}
tsc gives me an error:
'Object is possibly 'undefined'.
I know the original Request type does not…
I have a node.js application running on port 5000, where I use passport.js as authorization. I authorize users from a post request, where I use a custom callback:
this.router.post('/member/login', (req, res, next) => {
…