Closed prashantpandey9 closed 3 years ago
@prashantpandey9 There is nothing wrong with storing data in localstorage, if someone wants to hack you, then it is not a problem to take data away with cookies or with locvalstorage. But you still store all data in an encrypted format.
But if you want to use cookies, unfortunately there is no standard solution. There is such a plugin https://github.com/abersager/redux-persist-cookie-storage, I personally do not use it, I wrote my own solution (I need cookies for ssr)
@VictorPullzz Thanks for your reply!!
@VictorPulzz could you provide your workaround. I also need to store the state cookies for authentication in server-side rendering
Maybe using cookie storage is only way to share data between browser and server. Since there's maximum size per cookie(4096 bytes) limitation, we should only share the first screen data.
Is there any option to save the hydrated state in the cookies instead of local storage? I think it is dangerous to store auth data in local storage.
Please resolve my doubt!