session VS cookie-session

Compare session vs cookie-session and see what are their differences.

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
session cookie-session
5 3
6,178 1,104
0.2% 0.1%
7.2 7.2
about 2 months ago 3 months ago
JavaScript JavaScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

session

Posts with mentions or reviews of session. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-24.
  • express-session issues with firefox?
    1 project | /r/node | 10 Dec 2023
    https://github.com/expressjs/session/issues/360 this is an issue I think that's very close to mine, no concrete solutions though..
  • How to use Twitter OAuth 2.0 and Passport.js for user login
    10 projects | dev.to | 24 Nov 2022
    Passport needs to be initialized as middleware as well. And it requires a session middleware for storing state and user data. The most common session middleware is express-session.
  • REST api session handling
    1 project | /r/node | 8 Sep 2022
    You need to pick a session store for your cookies. By default, I think express-session uses an in-memory store which means sessions are reset every time the server restarts. Redis is what I'd generally recommend for managing session stores, but setting up Redis is ANOTHER configuration update. There are a bunch of other options, too, such as using a Mongo database as a session store.
  • Session Management on Google Cloud Run with Serverless Redis
    3 projects | dev.to | 5 Jul 2021
    If you want to store your session data manually on Redis, check here. But in this article I will use Express session middleware which can work with Redis for user session management.
  • JSON web tokens are NOT meant for authenticating the same user repeatedly: Use session tokens instead
    1 project | dev.to | 10 Apr 2021
    This problem can be solved by using a "session store" library such as connect-redis (see express-session's documentation for the list of session store libraries for Express.js). The idea is to keep session tokens in a dedicated database, and each time the user makes an HTTP request with their session token, the server receiving the request will consult this database to learn whether the request comes from the authenticated user or not. Performance suffers consequently, as retrieving data from a database always takes some time.

cookie-session

Posts with mentions or reviews of cookie-session. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-25.
  • Stop using JSON Web Tokens for user sessions
    3 projects | news.ycombinator.com | 25 Nov 2023
    The lack of logout and XSS are problems, but I ran into a couple apps that completely forgot to expire sessions due to lacking framework support. In nodejs's cookie-session and @google-cloud/connect-firestore sessions never expire. This issue impacts downstream software including, awkwardly enough, Google's Passkey demo apps. There isn't interest in fixing this.

    Make sure your app is actually using a JWT framework, not a lesser version, and implements basic security practices.

    [1] https://github.com/expressjs/cookie-session

    [2] https://github.com/googleapis/nodejs-firestore-session

  • Node Authentication Questions
    1 project | /r/node | 28 Feb 2022
    Side note: a JWT in an HttpOnly cookie, which is what some people advocate, is still a cookie-based session. Using a library like cookie-session would already give you the ability to have a signature-verified JSON payload, just like using a JWT would.
  • JWT should not be your default for sessions
    3 projects | /r/node | 10 May 2021
    Frameworks usually sign cookies by default, or at least offer an option to do so. Some (like Ruby on Rails) can encrypt them for you too. There's nothing really stopping you from storing data in them just like you would a JWT. In fact, frameworks and session libraries often use this cookie storage by default (even in the Node ecosystem, e.g: koa-session, express cookie-session), since an in-memory store can grow to an arbitrary size. Of course, you can also just store a JWT in a cookie, which has the advantage of being standardized in terms of claims and signing algorithms etc.

What are some alternatives?

When comparing session and cookie-session you can also consider the following projects:

TextSecure - A private messenger for Android.

vue-cookies - A simple Vue.js plugin for handling browser cookies

csurf - CSRF token middleware

body-parser - Node.js body parsing middleware

fastify-passport - Use passport strategies for authentication within a fastify application

koa-passport - Passport middleware for Koa

cookie-parser - Parse HTTP request cookies

restify - RESTful API template built on Express.js

a12n-server - An open source lightweight OAuth2 server

passport-twitter-oauth2LICENSE

session - Simple session middleware for koa