Andrew Chen

Andrew Chen

SDE @ StripeMS CS '19 @ UW-MadisonEnthusiastic about creating tools to make life better.

HTML

Back

cookies, sessionStorage and localStorage

  • cookies:

    • Generated from server side. Around 4 KB; used in the request header.
    • usage: login/logout
  • sessionStorage:

    • Maintains a separate storage area for each given origin that’s available for the duration of the page session (as long as the browser (or tab) is open, including page reloads and restores). Around 5 MB.
  • localStorage:

    • Same as sessionStorage but persists even when the browser is closed and reopened. Around 5
    • usage: shopping cart

doctype

data-

data-* attributes allow us to store extra information on standard, semantic HTML elements without other hacks such as non-standard attributes, extra properties on DOM,

semantic HTML

div vs nav