What is the main difference between localStorage and sessionStorage?
- A localStorage persists until cleared and is shared across tabs; sessionStorage is per tab and cleared on close
- B sessionStorage holds more data
- C localStorage is sent with every HTTP request
- D There is no difference
Answer
localStorage persists until cleared and is shared across tabs; sessionStorage is per tab and cleared on close
Both hold roughly 5-10MB of string data and neither is sent to the server. Only the lifetime and scope differ.





