Use
localStorage[
^] instead of cookies.
Cookies would be sent to the server with every request, and thus have a very small size limit. Local storage is never sent to the server
(unless you write code to do so), so you can store much more data in it.
Local storage is also much simpler to work with than cookies.
Using the Web Storage API - Web APIs | MDN[
^]