| ▲ | robgibbons a year ago | |||||||||||||
In both cases (cookie vs localStorage) you're really just storing your data as a string value, not truly a JSON object, so whether you use a cookie or localStorage is more dependent on the use case. If you only ever need the stored data on the client, localStorage is your pick. If you need to pass it back to the server with each request, cookies. | ||||||||||||||
| ▲ | recursive a year ago | parent | next [-] | |||||||||||||
JSON is explicitly a string serialization format. | ||||||||||||||
| ||||||||||||||
| ▲ | 0x073 a year ago | parent | prev [-] | |||||||||||||
Combine local storage with service worker, so you pass the data to the server if needed. Completely without setting cookies. | ||||||||||||||
| ||||||||||||||