I was looking for some clarification really. Looking at the W3Schools documentation on localStorage
and sessionStorage
, they write:
Local storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.
Does this mean that if I have multiple web front ends, and my load balancer is not using sticky sessions, that the data I store with the sessionStorage
object may not be accessible, dependent upon which WFE serves the data?
Just a little unclear, and it's difficult to test. Many thanks!
localStorage and sessionStorage are both stored in the browser, so your load balancer, sticky sessions, etc. will not affect these at all. They may affect any data you store in the session on your server though.
The difference between localStorage and sessionStorage is that sessionStorage is stored cleared when the page session ends, whereas localStorage has no expiration set.