Mrtenz / typeorm-store

A TypeORM-based store for express-session.
MIT License
16 stars 12 forks source link

expired sessions are not deleted from database #1

Closed tafkanator closed 5 years ago

tafkanator commented 5 years ago

there is no code that deletes expired sessions from database. It seems that some other stores implement interval based mechanism to delete expired sessions periodically from database

sequelize example: https://github.com/mweibel/connect-session-sequelize/blob/master/lib/connect-session-sequelize.js#L152-L173

mysql example: https://github.com/chill117/express-mysql-session/blob/master/index.js#L429-L445

Mrtenz commented 5 years ago

Thanks for letting me know. The implementation I originally based this on, doesn't include it, so I assumed it's not a standard. I'll update it soon.

Mrtenz commented 5 years ago

Implemented it here: https://github.com/Mrtenz/typeorm-store/tree/remove-expired-sessions, could you check if everything works as expected?

tafkanator commented 5 years ago

Thank You for the fast response. Tested on my codebase. It is working fine now.

Mrtenz commented 5 years ago

Thanks for testing! I published typeorm-store@1.2.0 to npm.

tafkanator commented 5 years ago

One note, You should update readme about adding new option parameters