I am using JWT to create and verify tokens and store the token in a cookie. (react front end vs Nodejs backend)
I am confused about the use of react-cookie vs universal-cookie and react-cookies.
What is the difference between these and what is the difference between setting cookies on the back-end vs the front-end?
I haven't used any of these packages however, all of those packages wrap native JavaScript methods for a simple use of cookies. Feel free to pick whichever you feel more comfortable with.
Regarding to your second question, there is no difference between them technically. Cookie is a browser-related feature and it's always handled by the browser.
If you set cookies in the back-end, server will add a cookie header that the browser will read and save it.
If you set them in the front-end, document.cookie
will be interpreted and cookies get saved by your browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With