Persist State with react, redux app and cookies

How can I achieve a persist state in the react app after refreshing the page? I don’t want to use localStorage and I am using cookies.

You need a “Database”!

I have never used it but there is an Redux Persist storage adapter for cookies.

i have db , i am using mongoDb

Then what is the issue you are facing while persisting data!

I don’t want to store my cookies in local Storage . So when i refresh the page i lost the state. if i want to persist the data using the cookie which is provided by backend how can i achieve it ?

What amount of state? You can store a whatever you want (stringified) in a cookie as long as it’s a very small amount of data (you have a 4kb limit over all cookies on the page) – that’s the point of them, and from what you’re asking I assume it’s what you need. Note that 4Kb is a hard limit: more and you’ll need LocalStorage or similar, you can’t really get around it

Edit: You would create a new cookie with the data you want. If you want to add data to an existing cookie, you don’t technically add data to the cookie, what you’d do is read the data from a cookie, delete it, and create a new one with the extra data appended.