DEV Community

Discussion on: Build a complete warehouse management system with React and Django.

Collapse
 
louy2 profile image
Yufan Lou

Please do not store secrets in the local storage. They'd be accessible by any third party script loaded to your website, and one cross-site scripting attack away from leaking.

For more, please read Please Stop Using Local Storage

Some other considerations regarding session ID security: On Securing Web Session Ids

Collapse
 
nyamador profile image
Desmond

Thank you. I wasn't really sure on it🙏.
I'll checkout the resources.

Collapse
 
gandalfarcade profile image
Chris Mumford

Definitely avoid storing your token in LocalStorage. Using a HttpOnly cookie might better serve you.

owasp.org/www-community/HttpOnly

I don't know the full context of your token needs but I would usually recommend using a JWT for granting access to an API. For most use cases they are a simple but effective solution.

blog.logrocket.com/jwt-authenticat...

Thread Thread
 
nyamador profile image
Desmond

Thanks Chris⚡