Skip to content
Security·Intermediate·Conceptual·1 min read

How should a frontend decide where to store an access token in memory versus persistent storage?

Short interview answer

In-memory storage limits exposure since it disappears on page reload and isn't reachable by looking at disk or browser storage inspection, at the cost of requiring re-authentication or a silent refresh flow after a reload.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Authentication: sessions vs. tokens

Related questions