DEV Community

Discussion on: Best Practices for Secure Session Management in Node

Collapse
 
rishpoddar profile image
Rishabh Poddar

Great article! Thanks. However, express-session focuses on a rather simple session flow. One can implement much better security by using short-lived access tokens and one-time use, long-lived refresh tokens as it's explained here: supertokens.io/blog/all-you-need-t....
In a nutshell, this method allows you to change the secret key instantly (as opposed to gradually fading out a key as shown in the article) and also enables detection of token theft (which express-session also doesn't provide).

Collapse
 
karandpr profile image
Karan Gandhi • Edited

Thank you for your comments!

As far as better security is concerned, it boils down to use cases and constraints(Time & Technical).

This article was written explicitly with express-session in my mind. It's a flexible library with which I can roll out my solutions depending on the use case.