I'm currently in the process of setting up a node server that includes login, logout, and authentication functionalities. However, I've encountered an issue with my code where after debugging, some debug information logs are being generated that I can't se ...
My Node application built with Express.js and Socket.io is facing an issue where they are not sharing the same session ID when running under iframe with different origins. When accessed directly or through iframes with the same origin, everything works fin ...
Currently, I am working on implementing a basic login system using express sessions. However, I have encountered an issue where I receive an "Invalid status code" message when the user is not found in the database. I am aiming to set it up so that if the ...
I am having issues with button visibility based on user authentication in my MySQL and EJS setup. connection.js const mysql = require('mysql'); const util = require('util'); require('dotenv').config(); const connection = mysql.createConnection({ host ...
UPDATE - I have ruled out a development environment issue as the same problem persists in production. Thank you for taking the time to look into this. I've searched through numerous questions and attempted various solutions with no success. To give you s ...
Currently working on developing a login PWA using React and Node for an established WordPress site. Any suggestions on how to verify the password provided by the user against the encrypted WordPress password created when the account was initially set up? ...
I am developing a basic MEAN application and I am interested in creating a custom user authentication system. My plan is to store the userId in the session upon login, and then verify the existence of the userId in the session on each page request (such as ...
I'm looking to implement persistent cookies in my app to avoid the need for users to log in every time they visit the website. The goal is to only require a login if they choose to log out. I'm curious if there's a way to set the maxAge of t ...
I recently completed a Full-stack MERN (React + Node.js + MongoDB) project by following a tutorial on YouTube. You can check out the tutorial here. The official GitHub repository for this project can be found at https://github.com/codinginflow/MERN-course ...
Currently, I am developing a node application that operates on the express web server using express-session and session-file-store for managing sessions. Since incorporating these components into my project, my debug console has been inundated with errors ...
Need help with app.get('/') not being called I am working on implementing cookies to allow multiple users to be logged in simultaneously. Currently, users can log in successfully. However, upon refreshing the page, all users get logged in as the ...
Currently, I have set up a /register router specifically for signing users up. In order to keep things simple right now, I am utilizing cookie-session instead of express-session. However, I've hit a roadblock when it comes to authenticating a user du ...
I'm working on implementing the session management for an express-js application using the express-session package. Here are the specific requirements I need to meet: The cookie should be destroyed when the browser is closed. The cookie should expi ...
Here is my situation: When a user logs into the app and then opens another browser window, they are already authenticated thanks to express-session, bypassing the login page. This pattern continues for subsequent browser windows. The issue I am facing no ...
Here is the provided code snippet: app.get('/vklogin', function(request, response) { console.log('Authorizing via "Vk.com" social network'.green); var url_parts = url.parse(request.url, true); var query = url_parts.query; var data = querystring.stringify ...
Is there a way to make cookies never expire for express-session? If not, what is the maximum maxAge allowed? I came across some outdated information on setting cookie expiration on SO (over 10 years old) and here on express, which mentions a maxAge of 1 y ...
I'm currently utilizing express-session for authentication in my web application. Unfortunately, I've encountered a persistent problem where the cookie expiration time isn't being reset with each request. Here's the code snippet that I'm working with: mai ...
I have experience building back-end applications with express.js, utilizing both express-session and cookie-session. However, I recently came across the cookie-parser package on npm, which seems to be quite popular. This has sparked my curiosity, Can so ...
I am currently utilizing the cookie-session module for Express.js to manage sessions. My goal is to refresh sessions on each page load or ajax call, as is typically seen in similar setups. Unfortunately, the documentation lacks any information regarding ...
When I log in, I want to be redirected to /makeitem, which requires a session to open. It used to work perfectly before I started using connect-session-sequelize. The cookie gets stored in db.Sessions right away so that part works. But now, after submittin ...
Utilizing Express-session, Connect-mongo, and PassportJS on a Node server, I have implemented the following validation function: expressApp.post('/login', function(req, res, next) { passport.authenticate('login', function(err, user ...
Whenever I close all browser windows and reopen the web app, a new session is initiated, forcing me to re-authenticate each time. To give you an idea, my web application framework is <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfema ...
On my website, I have a login page and a myservices page. Once a user logs in, they should be redirected to the myservices page where their username is displayed. In the login.js file, the following code is used: req.session.user = "abc"; res.redirect('/ ...
I've been working on an app with express.js and vue 3, incorporating session-based authentication. While everything functions perfectly locally, I've encountered issues when trying to deploy to production. Here's a snippet of the code where ...
I have followed the setup instructions for express-session as outlined in the documentation, but it seems that my cookie is not being created. According to the documentation, simply setting the request.session value should automatically set the cookie. How ...
I have implemented express-session and included a middleware that assigns the value of req.session.returnTo to the originalUrl. router.post( '/login', passport.authenticate('local', { failureFlash: true, failureRedirect: &ap ...
After attempting to log in for the first time, I noticed that the authentication process in AuthService sets the loggedInStatus to true. However, in AuthGuard, the loggedIn status is set to false, preventing navigation to the dashboard. Additionally, the c ...
I need some assistance with displaying a user's login history on the front-end of my webpage. I am using Express and storing sessions in mongoStore as shown below: app.use(session({ secret: process.env.SECRET, key: process.env.KEY, resave: false, ...
This is my first time deploying an app, and I'm facing a particular issue. When hosting the app locally, I can use mongo (via Atlas) without any problems. Users are created on sign up, and they have a session. However, when I deploy the code to Heroku (us ...
I am encountering an issue with my node.js express app where the sessions are not persisting and a new session is created for every request. If anyone can help me understand why this is happening, I would greatly appreciate it. Due to the size of the app, ...
I currently have a web application that utilizes React on the frontend and Express sessions on the backend for authentication and authorization. I'm interested in exploring if I can apply a similar approach to authenticate mobile users. In my web appl ...
Currently, I am working on integrating a login feature using express, nuxtjs, and express-session. The functionality works well without any issues until the page is refreshed. However, after refreshing the page, the session data is not retained. I have co ...
Working on a Single Page Application with Vue front-end, Express, and Parse (parse-platform) for back-end. After authenticating the user, I store their info in a session variable req.session.user = result; before sending it back to the client using res.sta ...
When it comes to my API, it relies on the express-session module for authentication. Each request is verified based on whether the req.session.user object exists within the request. The implementation can be seen in the snippet below: app.use(function(req ...
Struggling to access session variables in EJS views and encountering various challenges. To locally access req.session, I've implemented middleware as outlined in this guide on accessing Express.js req or session from Jade template. var express = re ...
I am currently working on a website that has two URLs ('/', '/admin') and I am facing session conflicts. Here is the code from my app.js: app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app. ...
I'm facing a challenge in identifying the user on my application using sessionId instead of actual user account information. However, I've observed that the sessionId changes every time the user interacts with the page, as seen below. My objectiv ...
I'm experimenting with using express-session and express-mysql-session in a Typescript project. Here's the relevant snippet of my code: import * as express from "express"; import * as expressSession from "express-session"; import * as expressMyS ...
Currently, I am working on developing a login system using NextJS and MySQL. I am looking to implement sessions for user login, but I am unsure of how to integrate express-session with NextJS. Can anyone provide guidance on whether express-session can be ...
I am facing an issue with my current code implementation. Here is the snippet: var express = require('express'); var cookieParser = require('cookie-parser'); var http = require('http') var app = express(); app.use(cookieParser()); var session = require('e ...
After discovering that express-session is not suitable for production environments without switching to something like redisStorage, I opted for cookie-session. The documentation appeared a bit confusing. It states Other options are passed to cookies.g ...
Currently, I'm going through Ben Awad's 13-hour Fullstack React GraphQL TypeScript Tutorial and I hit a roadblock while trying to set the login cookie around the 1 hour and 50-minute mark. I believe I successfully established a connection with r ...
Currently, I am diving into the Fullstack React GraphQL TypeScript Tutorial I encountered an issue while trying to connect Redis with express-session... import connectRedis from "connect-redis"; import session from "express-session"; ...
When looking at the express documentation, you will come across a differentiation between express-session and cookie-session. The explanation provided is as follows: There are two main ways to store a user session with cookies: either on the server or on ...
I am experiencing a challenge where Express is not including the Set-Cookie header when using express-session and setting the secure option to true. This issue arises specifically on a remote server with a valid certificate signed by Let's Encrypt. co ...
Utilizing Express-session within /api/login to store session data. I encountered an issue when trying to increment the count variable by one, as it always returned the number 1. Furthermore, the browser was not receiving the connect.sid value. Below is t ...
I have been working on an app that already has its own infrastructure. My current task is to integrate a session-cookie mechanism, but I've been struggling to make the cookies set on the client side after spending a significant amount of time investigating ...
I am struggling to test middleware functions in my Express application using supertest and nock. The issue arises from the fact that the routes I have configured are checked by a previous middleware function to ensure the existence of a session property on ...
In my MongoDB database, I have a collection named 'Sessions' within the 'SessionStore' to store session state. To manage sessions, I am using express-session. Below is the code snippet used to set up sessions: var session = requi ...
Occasionally, my nodejs program — which is built with the express v4.12.2 and express-session v1.13.0 packages — encounters a TypeError exception leading to a crash: /app/node_modules/express-session/node_modules/cookie/index.js:136 if (opt.expires) ...
Utilizing express session, I have configured the domain to be domain: 'mydomain.com' in order for the session cookie to function across subdomains such as api.mydomain.com and staging.mydomain.com. However, this setup hinders the Set-Cookie head ...