To achieve this, the following needs to be done:
- If the data exists in cookies, your page-load could be loading the information from the cookies and that's how you maintain the data and emulate the concept of database without having any server-side code.
- Then you need to encode this string variable using encodeURI function
- Then you need to split your encoded string into smaller pieces and create cookies with a specific naming convention and sequence.
Here is the example. You can refresh the page and close the browser and it will still maintain the updates you made as it is using a collection of cookies to emulate database.
- almirsCorner.com -