by parhamn · 8y ago · 0 comments
JWT/tokens + Local/session storage + adding fetch headers seems like the best way as long as you don't run untrusted JS.
What is your reason for preferring JWT + localStorage for authentication and session handling? I'm genuinely curious, as httpOnly cookies strike me as better in every meaningful way.
If the initial SSR needs some initial client-state to complete its work before sending the HTML payload, it can see the cookie, but not localStorage.