I just want to know which one is the best way to handle the cookies? Using Express.js? Node.js or client side javascript jquery?
I am little confuse with security perspective.
Thanks for all your help/information.
Cookies are HTTP concepts which is irrespective of the language / platform. So, Node.js is a server side platform while Express.js is a server side web application framework for Node.js and jQuery is a client side library.
From security perspective, you should not store cookie information in plain text. Also, " you shouldn't allow client side scripts to set or read the cookie value ". If you are already using Express.js, then I would recommend setting & reading of cookies to be taken care by your application using Express.js and ensure you encrypt the cookie values.
You should keep some session id in cookie, not actual data (it's true for most cases, especially for any user-related sensitive data).
The correct approach for using cookies would be:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.