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
1
vote
2 answers

What is "cookie-parser" middleware?

While creating back-end apps with express.js, I have used express-session and cookie-session. But, recently I found out this cookie-parser package on npm. It's pretty popular. My question is, What is cookie-parser and how is it different from…
Rahul Dahal
  • 152
  • 1
  • 12
1
vote
2 answers

Expressjs cookie-session settings not working with Passportjs

I'm trying to call my /auth/user endpoint to get the current user that's logged into my website. But because of the new Chrome update I need to somehow set 'sameSite' and 'secure'. Anyone know of how I can get around this? Am I doing something wrong…
1
vote
0 answers

Set user info with cookie-session

I'm using cookie-session to store all my session information. After my users login, I store his information inside req.session.user like this req.session.user = _.omit(client.dataValues, [ "password", "createdAt", …
lufizi
  • 403
  • 2
  • 7
  • 14
1
vote
1 answer

auth0+passport.js too many redirects with more than 1 instance

Infrastructure: cloud: aws beanstalk turn on nginx for container proxy server application load balancer - https only, default process (https) 2+ instance in private subnet enabled end to end encryption following…
1
vote
2 answers

Express.js, Passport.js, cookie-session, logout doesn't delete cookies

I'm using PassportJS and this code for logout: .get("/logout", async (req, res) => { await req.logout(); req.session = null; await res.clearCookie(process.env.PROJECT_TITLE.toLowerCase()); await…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
1
vote
1 answer

Empty object with req.session in cookie session express package

I'm trying to solve that for a long time. I'm trying to make cookie session using express cookie session and react on the front. Cookie should be in my req.session object but instead it is empty. Here's my code: const cookieSession =…
Murakami
  • 3,474
  • 7
  • 35
  • 89
1
vote
2 answers

can't store the cookie clientside when using cookie-parser

I am having difficulty getting my react app to work with cookie-session. When I look at my network and signup I do send a Set-Cookie. These are my response headers: Connection:keep-alive Content-Type:application/json Date:Fri, 09 Feb 2018 22:32:02…
frogtoprincejs
  • 141
  • 2
  • 12
1
vote
0 answers

Not being able to retrieve data saved in cookie-session

I am trying to make a dynamic website in Cloud Functions for Firebase. However, I am stuck at this point. What I am trying to achieve is that I want to save particular form details and then push them to the DB if the user is logged in. If the user…
Kamil Kamili
  • 1,757
  • 5
  • 24
  • 39
1
vote
1 answer

Logout a user without req object Passport js

I am using Passport js with Express js. In my application, I need a functionality that a user should be logged out from the server if he/she is idle for a certain time. But the problem is it requires req (request) object in order to logout a user.…
Arpit Kumar
  • 2,179
  • 5
  • 28
  • 53
1
vote
0 answers

Share cookie session on Express.js

I'm trying to share the same session cookie across two express.js apps. I'm setting the same secret and same key id on both app configurations. Then I have them running on the same domain (different ports). Both apps have the following in…
user313551
  • 355
  • 4
  • 15
1
vote
2 answers

Can't use connect-redis in Express.js

I'm studying Express.js and learned how to handle sessions using cookie-session module. I'm trying to use express-session but I have problems. Previously, I was using cookie-session instead of express-session, and memoryStore worked perfectly.…
Luis Arriojas
  • 561
  • 3
  • 8
  • 19
0
votes
0 answers

How to use 'svelte-kit-cookie-session' package?

According to , I wrote the code as shown below. src/hooks.ts import { handleSession } from 'svelte-kit-cookie-session'; export const handle = handleSession({ secret:…
myon
  • 1
0
votes
0 answers

Passport.js with cookie-session showing authenticated by hitting browser search bar with calls but not within the frontend application fetch calls

So I recently deployed to production and all my endpoints except the endpoints involving authentication work. I have a webserver running my backend and a static site running my frontend. I was playing around with it and I found that if I log in…
0
votes
1 answer

Resetting cookie-session expiry time

I am trying to set the expiry time of cookie-session dynamically based on the value pulled from the database. For some users the value might be less or more than other user. When the server initializes this is how I am setting up my…
goxarad784
  • 395
  • 6
  • 17
0
votes
0 answers

How to create custom connect.sid cookie?

I try to create custom connect.sid cookie like express-session cookie. Here example: const sessionObject = { passport:{ user: id } } const cookie = some_function( JSON.stringify(sessionObject), "secret_value" ); How…
feruz00
  • 53
  • 7