Skip to the content.

Where does the session actually live?

Session handling is where frontend architecture meets security, and where the convenient choice and the correct one usually disagree.

Your SPA stores its access token in localStorage so the app can read it after a reload. What is the concrete risk?

You move to an httpOnly cookie. What does that NOT solve?

A server-rendered page needs the user's name on first paint. Where does the session check belong?

Your access token lives 15 minutes and a refresh token renews it. Two tabs hit expiry at the same moment. What goes wrong, and what fixes it?