Comments (3)
This sounds like a generic issue that all session stores for Express would have? No matter if they are stored in Postgres, MongoDB, Redis, MySQL or something else – if one wants it to be unique then I'm not really sure it belongs just in the session store.
Have you found out how others have solved this with Express? Is there some practice for limiting the amount of sessions per user? If it's just a matter of adding support for an established practice, then I may consider doing so – but adding this as a new unique feature kind of feels like it goes against the simple
in the name of this modules. What do you think?
from node-connect-pg-simple.
I thought "simple" referred to the configuation.
There appears to be no feature like this in node yet. When i talk to the express/connect people they say no session store implements this, and they don't make everyone upgrade unless the session storea support it already. Whe i talk to the session stores, they say express/connect does not implement this, so I'm in the situation that this is clearly a useful and needed feature, but due to a chicken and egg problem, it will never happen.
I think the express/connect people want a proven api to use along with a reference implementation to verify against before they ask all the session stores to implement it.
from node-connect-pg-simple.
The tricky thing would probably be to define an API for explaining the new constraints to the module in a generic way – easier would probably be to just subclass this module and wrap an extra step prior to the set()
and/or get()
methods where the specific constraints needed are enforced – like the passport user or something.
Depending on the size of ones applications one would probably also want some indexes added to those specific keys in the JSON as well – so that things doesn't get too slow – also something that's hard to do in a generic way.
Something else to think about as well is how one would go about forcibly expiring a session – there might be some edge cases where a session might have been fetched, but not yet updated, when it's expired – perhaps causing it to get recreated when it actually do get around to updating itself.
Does the subclass-route sounds like a possible way forward? To eg. create a passport-specific subclass of this?
from node-connect-pg-simple.
Related Issues (20)
- Error thrown when setting a session when connecting to Heroku-hosted PostgreSQL HOT 2
- @types/pg as dev dependency HOT 7
- Use ES6 import HOT 3
- Change `pg` to a peer dependency HOT 2
- db.bit.io issues HOT 8
- 'Failed to prune sessions: con.connect is not a function' when trying to connect PostgreSQL database with session store via Knex.js HOT 1
- error: date/time field value out of range: "1655239143" HOT 4
- Failed to prune sessions: relation "session" does not exist HOT 3
- Two sessions being saved to store HOT 1
- If at the first try to create the session table the database is down, the store fails forever HOT 3
- Getting error "Error: connect ECONNREFUSED ip_address:5432" intermittently when the RDS is restarted.
- Getting error "Error: connect ECONNREFUSED ip_address:5432" intermittently when the RDS is restarted. HOT 2
- Unexpected token in node_module index.js HOT 2
- Using "pruneSessionInterval=false" will unexpectedly disable "createTableIfMissing=true" HOT 3
- Property "replaceAll" does not exist on type "string". HOT 4
- pg-simples tries to access wrong column HOT 1
- createTableIfMissing is not working in version: 9.0.0 HOT 5
- TypeError: (0 , connect_pg_simple_1.default) is not a function HOT 2
- session_id is ignored and a new one is generated instead HOT 5
- Getting "Pool is missing for some Reasons", If not there is no communication between Client and server for more than 24 hours HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-connect-pg-simple.