grofers / redux-cookies-middleware

redux-cookies-middleware is a Redux middleware which syncs a subset of your Redux store state with cookies.
MIT License
81 stars 16 forks source link

Unexpected initial state mutation #49

Closed futpib closed 5 years ago

futpib commented 6 years ago

The getStateFromCookies(initialState, paths) call will mutate initialState.

In server-side rendering setting this leads to really bad stuff like different users getting other user's cookies in their state.

Had to do getStateFromCookies(clone(initialState), paths) to avoid this.

ashbhir commented 5 years ago

Issues fixed by PR #51. Hence closing the issue.