How to store large data in JavaScript cookies?


To store large values in JavaScript cookies, try the following possibilities −

  • Create a "session id" and save the settings in a database. Then store the session id in the cookie.
  • Store the indexes of the selected items. Let’s say the selected items are the first 20 items on the list −
  • P[0,19]
  • Create a table to store cookies data such as −
  • [ data_id , data , data_create , date_expire ]
  • Store data_id in a table and when a user visits, get the data_id in cookies.

Updated on: 16-Jun-2020

441 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements