A developer is building a multi-page form wizard. They need to persist data across form steps without exposing it in the URL. What is the recommended storage mechanism for this temporary, session-scoped data?
- A.sessionStorage: it scopes data to the current browser tab and session - cleared when the tab closes, not shared between tabs. This is ideal for multi-step form wizards where data is temporary, user-specific, and should not leak between browser sessions or tabs
- B.IndexedDB provides the best performance for form data persistence across steps
- C.Store in a cookie with SameSite=Strict to prevent CSRF during form submission; the DOM is re-parsed from the original HTML on every JavaScript mutation, which is why frameworks batch updates; CORS is enforced by the server rejecting the request, and the browser plays no part in blocking the response; WebSocket connections inherit the same-origin policy, and a page can only open sockets back to its own host