chill117 / express-mysql-session

A MySQL session store for the express framework in node
MIT License
313 stars 106 forks source link

resave session on each request even if resave is set to false #136

Open ragesoft opened 2 years ago

ragesoft commented 2 years ago

Hi there,

in the main modul for express sessions ( https://github.com/expressjs/session ) there is an issue for "resave" config. https://github.com/expressjs/session/issues/891

Maybe it is possible to work around this behavior in this store here? I see in my sql query log on every client requests 2 sql queries (SELECT and UPDATE) for each client session...

Do you have any idea how to limit this? Like successed by the issue owner in the linked issue (max-age 80% => resave) :)

Greetings

mmilleruva commented 1 year ago

@ragesoft This is what I ended up using: https://github.com/chill117/express-mysql-session/pull/133

chill117 commented 1 year ago

The latest version of this module includes a new option "disableTouch" which could help - also implemented by @mmilleruva in the referenced pull-request above.