koajs / generic-session

koa session store with memory, redis or others.
MIT License
414 stars 65 forks source link

fix: set expires= on all session cookies when destroying a session #134

Closed ejose19 closed 4 years ago

ejose19 commented 4 years ago

Implementing https://github.com/koajs/session/pull/180 on this library as when setting session to null only the sid cookie was getting "expires=epoch" and not the sid.sig, due to cookies library requiring options to exist for also updating sid.sig, see:

https://github.com/pillarjs/cookies/blob/d2111627e8ff2e29f90e75d1f1cc4164c5a07a3f/index.js#L108-L113

ejose19 commented 4 years ago

@niftylettuce @dead-horse Could you guys take a look on this PR?

niftylettuce commented 4 years ago

v2.1.1 released, thank you @ejose19

I also recently added async/promise support to genSid option as of v2.1.0, which allows us to use things like cryptoRandomString's .async method per https://github.com/sindresorhus/crypto-random-string.

https://github.com/koajs/generic-session/releases/tag/v2.1.1