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
17
votes
2 answers

Stay signed in option with cookie-session in express

I would like to have a "Stay signed in" option such as the one provided by Gmail. This way, the user can decide if they want to keep the session open upon opening a new browser session after previously closing it. Looking into the github issues I…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
10
votes
2 answers

choose between asp identity claims and sessions data

I am trying to make a choice between storing user specific data in my MVC application either as identity claims or as session data to reduce the number and frequency of database round trips on requests. However, considering performance, security and…
7
votes
2 answers

What is the point of keys prop of cookie-session library for ExpressJS?

I am studying back-end programming, specifically with Node.js and ExpressJS and currently it baffles me how does the "keys" prop of cookie-session library help us? What is the point of it? Have been reading a lot of different materials related to…
Eduard
  • 8,437
  • 10
  • 42
  • 64
5
votes
3 answers

Updating cookie session in express not registering with browser

I've set up a working login test as follows: var express = require('express'); var fs = require('fs'); var http = require('http'); var path = require('path'); var routes = require('./routes/index.coffee'); var passport = require('passport'); var…
Casper
  • 61
  • 1
  • 4
4
votes
0 answers

express cookie-session failing on mobile

I am trying to use cookie-session in express / nodejs, my setup works on PCs, but not on mobile: on Android/Firefox, I can setup the session cookie, but I cannot modify it once set, I can't event erase it by setting req.session=null. Android/chrome…
Will59
  • 1,430
  • 1
  • 16
  • 37
4
votes
2 answers

Why use cookie-session in addition to passport.js?

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…
3
votes
1 answer

Client not receiving session data from server using Node, Passport JS, and cookie-session

so i've been using development servers this entire time, and everything's worked fine. Now, as I've deployed my client and backend, i'm running into an issue where my client cannot grab the sessional data from the cookie. i've checked both the…
3
votes
2 answers

Passport Serialization and Deserialization Vs JWT

I am using passport-local, passport-jwt module for authentication strategy in my application. I am trying to understand would I still need to use passport.serialize() and passport.deserialize() methods. As far as I understand these methods uses…
Roshan
  • 150
  • 16
3
votes
1 answer

Auto login while using passport-google-oauth20

I followed a course and it implemented user authentication using passport, passport-google-oauth20, cookie-session and it all works fine (login, logout, session handling) but when i send a request for a Log in/Sign Up it doesnt ask/prompt the google…
Roger S
  • 31
  • 3
2
votes
0 answers

Why cookie-session is not saving a cookie?

I am using cookie-session to check the id of an user: const cookieSessionMiddleware = cookieSession({ // secret: secretcookie.cookieSecret, secret: "dont look here, it will be a secret", maxAge: 100 * 60 * 60 * 24 *…
2
votes
1 answer

req.cookies undefined express js cookie-session

Req.cookies is undefined whilst req.headers.cookie contains the cookies, I am using cookie-session and express. I am declaring cookie-session before the routes. For refrence I grabbed my code from this article:…
Eliasd
  • 21
  • 1
2
votes
0 answers

What's the difference between cookie-session and JWT tokens?

This library here stores your session data on the client https://www.npmjs.com/package/cookie-session. But doesn't that make it a JWT token (as opposed to a "session")? Is the difference that cookie-session stores the data in cookies, versus JWT…
David McNamee
  • 403
  • 4
  • 10
2
votes
1 answer

Isn't cookie-session in express essentialy the same as JWT tokens?

In the express documentation a distinction is made between express-session and cookie-session. There it says: A user session can be stored in two main ways with cookies: on the server or on the client. This [cookie-session] module stores the…
symlon
  • 35
  • 5
2
votes
2 answers

How to initiate session on signup with cookie-session and passport.js?

I have a /register router for signing up a user. I am using cookie-session (which is similar) instead of express-session for simplicity for now. I am stuck on the part where I need to authenticate a user on sign up. I am confused about the…
2
votes
2 answers

Conditional app.use in node - express

Is it possible to conditionally use app.use in app.js? Express cookie-session can not change the value of maxAge dynamically and I was thinking of doing something of this kind, but I'm getting some errors: app.use(function(req,res,next ){ …
Alvaro
  • 40,778
  • 30
  • 164
  • 336
1
2 3 4 5 6 7