My understanding of passport.js so far is that passport.js serializes the user object and sends an ID every time to the client. I am just starting with it so sorry if it's a silly question:
Instead of express-session, I am using cookie-session as I…
I am currently working on a new project and I use sessions with the express-session library.
Here is the code where I set up the session:
const IN_PROD = process.env.MODE==='production'
app.use(session({
name: 'sid',
secret: 'asecret',
…
Say you want a user to enter their email through input, and want to capture that email and persist it over multiple web-pages. Is it bad practice to store the email in the session object in express-session?
Something like:
req.session.email =…
Chrome is changing the default value of SameSite cookie attribute from None to Lax as of its version 80. My site is embedded to another site using an iframe and the login session of my site is handled by express-session.
For new browsers the…
I am trying to implement simple authentication with Node, Express, Express-Session and Passport.js. As a storage middleware I'm using connect-pg-simple as I am using pg-promise in my project.
I managed to configure passport to work with my routers…
I'm trying to use mssql-session-store as nodejs (express) store for session:
https://www.npmjs.com/package/mssql-session-store
This is how it should be configured(from npm page):
app.use(session({
secret: 'keyboard cat',
resave:…
I have an extremely small express app to illustrate a problem I'm having.
I'm using connect-redis as a session store on my express app. I'm having a problem simply connecting to it though. Simply printing out req.session.store results in undefined…
I'm using NodeJS + express + express-session to persist a userID from anywhere in the application.
On the first route, my session is defined
userProfileRoutes.route('/authentication').post((req, res) => {
req.session.userID = 10; //example
…
I am trying to make Express session work with Next.js, and have successfully done so on the client side, but I am having trouble with API calls made from inside getInitialProps.
Note: I am using isomorphic-unfetch to make API calls. My Next.js…
I have an application using Angular and Node (Nest JS) , in the server side i'm using express-session.
In my middleware i'm adding the logged in user to the session:
req.session.user = user;
When the user tries to login using an Iphone he is not…
I'm using Passport.JS with express-session and a MySQL database to handle user authentication. Everything was working fine until I removed all the sessions from database 'sessions' and all the users from database 'users'. Ever since then, I keep…
I am currently using express and express-session to save information. If I save a session variable like this in file 'routes/login.js'
req.session.user = "User1"
How do I then access that same variable from 'routes/index.js' because currently if I…
I am using express-session and I need to create a session secret.
I have read that the secret is used for hashing.
How long and what characters should this secret have?
I was thinking about a random alphanumerical string like this:…
I need to retrieve a list sessions from sessionStore(MongoStore) and delete previous login session. I am using express-session to store sessions in DB.
var userId = req.query.userid;
if (!userId)
return res.status(400).send({
message:…