Storage size

  • Cookie: The data size cannot exceed 4K
  • LocalStorage, sessionStorage: data size support about 5M, different browser storage size is different

Life cycle (effective time)

  • Cookie: You need to set an expiration date, after which the cookie will be destroyed
  • LocalStorage: Permanently exists unless cleaned up manually
  • SessionStorage: The page will be destroyed when it is closed (including the TAB)

Storage form

  • All three are stored string types, and complex objects can be handled using JSON’s Stringify and Parse methods

security

  • Cookie: The request is usually carried in the header
  • LocalStorage, sessionStorage: will not be carried when requested

additional

  • This article is published through multiple platforms of “We Media” and will not be maintained after publication. If you have any objection to the content, you can discuss it in the GitHub below
  • The ongoing maintenance / 500 + face questions before update/notes 】 https://github.com/noxussj/In…
  • [3D city modeling using three. JS (Zhuhai City)] https://3d.noxussj.top/