Questions tagged [cookie-session]

Simple cookie-based session middleware for Express.js framework.

cookie-session is a simple cookie-based session middleware for Express.js framework.

94 questions
0
votes
0 answers

serializeUser in passport.js doesn't add user data into session in express.session

I am building a MERN stack app, and there is a problem with authentication and passport.js during production when using render.com to deploy my site. Now, the authentication, passport.js, and everything was working with localhost, but it doesn't…
0
votes
0 answers

How to get express session in getServerSideProps() - Express, Nextjs

I want to set up a checkout page while preventing users that aren't connected and do not have any current cart to access this page. I'm trying to implement this verification on getServerSideProps() function. Cart information is stored in…
0
votes
1 answer

Django doesn't set cookie and doesn't create session

I have a problem setting cookies in Django. Basically I have 3 different cookie I wanna set: Session ID Access token Refresh token For some reason Access and Refresh tokens are set, but the Session ID (SSID) doesn't set. If I change key of "SSID"…
0
votes
0 answers

Passportjs send different data types to req.user and serializeUser

I'm implementing a basic local authentication flow with passportjs and cookie-session middlewares in my node server. TLDR: Inside verifyCallback I query the database for the user data and in response I receive an object like this: { _id: '...', …
GhostOrder
  • 586
  • 7
  • 21
0
votes
1 answer

My Web App Keeps Logging Me Out Node.js Express.js express-session

My website keeps logging me out when I try to access other pages when logged in. I am using cookies to store the session but, I guess I did not do it properly cause even after authentication, I am being continuously logged out. It is not letting me…
0
votes
1 answer

Sometimes "cookie-session" cookies cannot be modified any more

I have a NodeJs Express server where I use the cookie-session module to keep a simple session in a browser cookie. All works fine, except that sometimes (once every few weeks on my dev machine), I cannot modify the cookie any more, nor can I delete…
Will59
  • 1,430
  • 1
  • 16
  • 37
0
votes
0 answers

I can't delete nor initialize selected cookies

Hi I'm trying to delete selected cookies drom the website I'm working on but for some reason they aren't deleted That's what I tried to do: var cookiesList = ["amp_c480ca","_gat","_gcl_au","_gid","_ga","_hjSessionUser_2101300"]; var path = "/"; var…
0
votes
1 answer

Unable to use session cookie in server-side request (getServerSideProps) in Next.js

I'm trying to perform a request to a backend service using Axios inside getServerSideProps, but it is failing because the session cookie that is needed for authentication is not included in context.req headers. The application has its client on a…
0
votes
1 answer

node express cookieSession cookies not being set

A node express api for SPA with the following: const express = require ('express'); const bodyParser = require ('body-parser'); const cookieSession = require ('cookie-session'); const cors = require ('cors'); const app = express(); app.use…
minisaurus
  • 1,099
  • 4
  • 17
  • 30
0
votes
0 answers

Client still sends cookie after logout in Express app with cookie-session

I'm trying to set up cookie authentication in my Angular/Express app. I'm using cookie-session to configure the cookie : app.use( cookieSession({ name: "marketplace-session", secret: RSA_PRIVATE_KEY, httpOnly: true, secure: true, …
0
votes
1 answer

How do you see the contents of Cookies in Use on Android Chrome?

Ive been searching for the past 2 hours and all the results are just blocking and clearing cookies and I DONT want that. I want to view the contents of Cookies like this image here but on Android website folder with cookies and it's content
0
votes
0 answers

req.session created by cookie-session middleware of express is not accessable in other subroute

session package of npm for implementing authorization and authentication in app.js(nodejs) statement is written like app.use(cookieSession({ name: 'wrtpsess', keys: ["dsfewfsffe3243efds"], // Cookie Options maxAge: 24 * 60 * 60 * 1000, // 24…
0
votes
1 answer

How to properly configure csurf with cookie-session in express?

I'm trying to setup csrf protection using cookie-session as the csurf docs mention it explicitly, but loading my /form page returns a 500 and 'misconfigured csrf' is logged to the console. import csrf from 'csurf' import express from…
amadesclaire
  • 411
  • 4
  • 10
0
votes
2 answers

When I use Express cookie-session, is it enough to delete the cookie client-side in order to logout?

I'm using Express cookie-session for authentication, which, if I understand correctly, works by storing a cookie locally in the browser of the user and no session data client-side. The documentation says that in order to logout we should set…
Florian Walther
  • 6,237
  • 5
  • 46
  • 104
0
votes
1 answer

How do I set cookie values dynamically in "HTTP CookiesManager" i.e. ai_user & ai_session for incoming user in ecommerce site in JMeter?

I want to set user defined cookies value i.e. ai_user & ai_session dynamically for each user in "HTTP CookiesManager" in JMeter, as it happens in browser ecommerce website. It's hard code for now but I want it's value dynamic & unique for each…