Comments (9)
I think this exists?
https://github.com/expressjs/session/blob/master/session/session.js#L42-L52
#2
from session.
I think that only applies to the cookie; the ticket is about applying a max age to the store itself.
from session.
I have added maxAge and other convenient methods to Store... a pr will be available soon....
Giving a maxAge to the session store allows to expire the data without expire the cookie and vice versa.
In my opinion if the cookie expires also the store should expire... what do you think?
from session.
In my opinion if the cookie expires also the store should expire... what do you think?
That does not work for session-length cookies, since the cookie cannot have an expiration to have it automatically expire when the user closes their browser. The store still needs to be able to expire, though.
from session.
Sorry, you're right, for "expired cookie" i was meaning "needs to be destroyed".
from session.
This seems like a store specific feature. For example, a mongodb store lib could use mongo's "TTL" collection feature. Is this ticket suggesting we implement this feature for the memory store?
from session.
Yes, this would be for memory store
from session.
I have been looking at this for a bit now. There seems to be an attempt to do this here, but I don't think this will ever work. Because the only way the session is destroyed is if the cookie sent from the client has expired, but the cookie won't be sent if its expired, right?!? I wrote a test to explain what I'm seeing.
A solution for this would be to setup the MemoryStore to check itself for expired sessions. That seems like overkill to me, but I don't know how else this could be implemented.
from session.
Lets just not bother until we remove memstore
entirely in favour of some sort of cookie-store for default.
from session.
Related Issues (20)
- When Run frontend and backend in diff domain it not working HOT 2
- Undefined session object with apollo v4 express and express-session HOT 1
- Regenerated session is re-saved even if not modified since save HOT 1
- Allow for sessions to be shared between subdomains. HOT 1
- Invalid argument type express-session "1.17.3" and redis "4.6.7", HOT 1
- Request session destroy does not always resolve before returning HOT 1
- TypeError: Cannot read properties of undefined (reading 'reload') HOT 4
- [FEATURE REQUEST] Session Async Methods
- `SESSION.DESTROY()` DOES NOT DELETE SESSION. HOT 7
- A `destroy`ed session is still `touch`ed HOT 1
- cookie options won't get set HOT 13
- [Feature Request] Support of phasing out third-party cookies HOT 16
- req.sessionStore.all with typescript bug? HOT 7
- Don't `Set-Cookie` for static/public files? HOT 2
- Issue HOT 1
- Can't set partitioned cookie even though I updated all of the package HOT 6
- 'sha1' hash algorithm used at index.js is unsafe HOT 3
- Any good ways to refresh database data with a session? HOT 4
- Get session object from `req.session` outside of request context HOT 3
- express session is failing because session is undefined 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 session.