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
1 answer

Express module cookie-session not including SameSite and Secure in Response Set-Cookie

Seen this before here, but I've seen no real resolution. The server's Node Express express-session module OR cookie-session module sends back a Session Cookie, but as I had not coded in the SameSite/Secure attributes, they are not there and do the…
Ric
  • 796
  • 12
  • 28
0
votes
1 answer

How we can get cookies of web App through inspect and import them to JMeter so we can pass some dynamic values to other APIs?

I want to know how we can get Cookies of specific website home page from browser through inspect element, and then pass cookie data to other APIs as dynamic variable in jmeter.
0
votes
2 answers

Express cookie-session not saving cookie when SameSite is set to 'none' and secure is set to true

I am using cookie-session and passportjs to authenticate users in my express app. When I initialize my cookieSession like this: app.use(cookieSession({ maxAge: 24 * 60 * 60 * 1000, keys: ['key1'] })); my cookie is successfully saved to the…
Andrew
  • 240
  • 1
  • 3
  • 13
0
votes
2 answers

Generate unique sessionId with Express Cookie-Session

I'm using node/express.js with cookie-session in my application. Currently, when a user logs in a cookie is stored in their browser with a value, for example: session: ABC123. If the user logs out, the cookie is deleted. When the user logs back in,…
Sajjan Karn
  • 50
  • 1
  • 7
0
votes
3 answers

How to create a cookie with node cookie-session

I am running a small node app. And I am trying to get it to create a cookie for each visitor, called 'session' that contains - for example - the session id. But I cannot seem to get node to create a cookie through cookie-session. My code so…
jlanssie
  • 97
  • 10
0
votes
1 answer

React.js + Express on Node.js: What is the correct cookie setting for cross-site requests?

I just want to share cookie setup for cross site requests (FE hosted on Firebase, BE hosted on Heroku) that I wasn't able to find anywhere, just a piece of info there and a piece of info somewhere else. The setup is as follows: React.js (Firebase) -…
0
votes
1 answer

nodejs cookie-session typeerror

TypeError: this.keys.index is not a function the console log show that the if condition line is error app.get('/',(req,res)=>{ if(!req.session.authenticated){ res.redirect('/login'); }else{ res.redirect('/search') …
sean
  • 1
  • 2
0
votes
1 answer

I need that the last 3 searches are saved in a cookie and displayed

I want the last 3 searches to be saved in a Cookie and displayed in a '< p>' tag. Here is my HTML code:
Adii
  • 5
  • 3
0
votes
0 answers

Why is the web browser not setting my cookie?

I am using the cookie-session package. app.use( cookieSession({ signed: false, secure: false }) ); When a user signs up, I set the session property to an object. req.session = { jwt: userJwt }; The cookie is successfully sent to the…
0
votes
1 answer

How is 'req.session' change detected in cookie-session middleware?

From the Readme.md file, it says, The middleware will automatically add a Set-Cookie header to the response if the contents of req.session were altered. Where is the implementation of detecting req.session change? Could you point me to the code or…
Sabbiu Shah
  • 1,569
  • 3
  • 16
  • 28
0
votes
1 answer

Express Cookie Session 'undefined'

After I define a cookie in an express cookie session, I can log it to the console with ease. However, when I attempt to access this cookie in another route of my application, it returns 'undefined'. Setting the cookie: router.get('/callback',…
user11139426
0
votes
0 answers

session.cookie_secure not saving

I am using sessions to create temporary file download links. Every time a new request is made, the sessions reset. I found a thread talking about turning on session.cookie_secure. But whenever I try setting it to on or 1, it won't save. Here is what…
Parsa Yazdani
  • 164
  • 1
  • 11
0
votes
1 answer

express cookie not set in response, not shown in next request

There are several moving parts, so it's difficult to know what to debug here. I have a web application on one localhost port, and a simple helper on another localhost running an express NodeJS application with a couple of endpoints. The basic…
Randy Hall
  • 7,716
  • 16
  • 73
  • 151
0
votes
1 answer

Express application level middleware and cookieSession, need to add in parameter from prior middleware

I am trying to pass a parameter from one middleware to the next. The first middleware is just storing a secret key in req.cookieKey. The second middleware is using express's cookie-session. Normally I would know how to do this but something is…
Matt P
  • 1
  • 2
0
votes
1 answer

My cookies don't persist after i restart the browser

I am using cookieSession to deal with session matters. No problem except when i restart the browser, my session doesn't persist. I wish sessions remain active every time and never expire. Here is my setup app.use(cookieSession({ name: 'xxxx', …
John doe
  • 3,680
  • 7
  • 31
  • 65