Coder Social home page Coder Social logo

Comments (1)

benjie avatar benjie commented on May 20, 2024

what is the use of connect_pg_simple_sessions table within the app

You don't need it; it's only there in case you don't want to use the redis session provider (or provide your own).

How can we track user's session after their login like we normally do in normal express js app using any session library (i.e. like this conect pg simple for instance)?

You can do it like you normally do in a normal express js app using any session library. You can replace the session store with whatever you want:

const store = process.env.REDIS_URL
? /*
* Using redis for session storage means the session can be shared across
* multiple Node.js instances (and survives a server restart), see:
*
* https://medium.com/mtholla/managing-node-js-express-sessions-with-redis-94cd099d6f2f
*/
new RedisStore({
client: redis.createClient({
url: process.env.REDIS_URL,
}),
})
: /*
* Using PostgreSQL for session storage is easy to set up, but increases
* the load on your database. We recommend that you graduate to using
* redis for session storage when you're ready.
*/
new PgStore({
/*
* Note even though "connect-pg-simple" lists "[email protected]" as a dependency,
* it doesn't `require("pg")` if we pass it a pool. It's usage of the pg
* API is small; so it's compatible with [email protected].
*/
pool: rootPgPool,
schemaName: "app_private",
tableName: "connect_pg_simple_sessions",
});

[semi-automated message] Thanks for your question; hopefully we're well on the way to helping you solve your issue. This doesn't currently seem to be a bug in the library so I'm going to close the issue, but please feel free to keep requesting help below and if it does turn out to be a bug we can definitely re-open it 👍

You can also ask for help in the #help-and-support channel in our Discord chat.

from starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.