Core: learn it Step 12 of 16 on the Full-Stack Developer roadmap
Storing credentials safely
Where you keep a token matters: localStorage is easy but readable by any injected script, while HttpOnly cookies are hidden from JavaScript. Understand this trade-off before you choose.