chill117 / express-mysql-session

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

change package from mysql to mysql2 #139

Closed LaurentDhont closed 1 year ago

LaurentDhont commented 2 years ago

Also upgraded express-session to 1.17.3

The reason why I wanted to change the package is because using mysql2 with express-mysql-session doesn't work and has issues with changing session data (probably because it doesn't wait for the promise to resolve). But when just sending the connection params (it uses mysql) and we cannot have caching_sha2_password and this is a security issue.

Please make it work with mysql2 or just change the package.

chill117 commented 2 years ago

Please see the with mysql2 section in the readme.

LaurentDhont commented 1 year ago

I know that the package "works" with mysql2 but it doesn't wait for the session to be saved and this is an issue that is hard to debug on very fast applications (like localhost).

MegaTeam89 commented 1 year ago

I've been using this fix ever since I've gotten mysql deadlocks and it works flawlessly, never had a problem after switching the package. Really hope that this does get fixed for people that use the mysql2 package.

chill117 commented 1 year ago

Thank you for taking the time to create a pull-request. The latest release of this module uses mysql2 instead of mysql.