how to make vue.js login/registration with vuex and cookies and not with localStorage

Viewed 380

I don't understand the logic how to do vuex and cookies and login/registration. with LocalStorage it's easy, I save user's token in vuex store and also in localStorage. How do I make login/registration so that I still use vuex and also httpOnly cookie that is read only from server? how Do I connect vue.js app and back-end by using cookies ?

1 Answers

If you have working logic that works with localStorage, then you can use js-cookie library, that will provide similar to localStorage API for setting and reading browser cookies.

Related