After I get the user data from the database, I should put it in Cookie or LocalStorage, which is faster to read locally?

this is the data I want to store. Is it better to store it in Cookie or LocalStorage?

{
  code:200,
  msg:"",
 "user_id": 3,
 "user_type": 2
  data:{
   expire:7200,    -sharp
   token:"9mzdDZXu3dENdFZQurfg0Vz8slgSgvvOAUebNFzyzcpQ5EnbxbF+hfG9DQkpUVQdh
        4p6HbQcAiz5RmuBAja1JJGgIdJI",       -sharptoken 
 }
}

Cookie is carried in HTTP headers every time. Does putting this data in Cookie cause performance problems?

Apr.05,2021

cookie consumes the server's bandwidth if your bandwidth is small, but the traffic is heavy.
if the traffic of general small websites is small, it doesn't matter.
one thing about putting cookie is that it can be obtained on the server side, and the cookie can be set and modified on the server side.
localstorage can only be modified on the client using js.


everything that does not need to be passed to the backend is put in the front-end cache (localStorage is a kind of front-end cache). All the things that need to be passed to the backend are put to cookie or passed to the backend through request parameters

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5dc2-317a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5dc2-317a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?