Earlier quoted context omitted.
Seconding (thirding?) this. I'm curious, are there any SPAs that aren't done this way?
app.example.com vs api.example.com ?
SPAs Are Dead?
11–20 of 118 posts
Re: SPAs Are Dead?
#12Cookies suck. The interface is beyond terrible, they were never scoped properly, and they don't have to be used. Browser storage (sessionStorage, localStorage) is perfectly valid for storing an authentication token.
Re: SPAs Are Dead?
#13Cookies suck. The interface is beyond terrible, they were never scoped properly, and they don't have to be used. Browser storage (sessionStorage, localStorage) is perfectly valid for storing an authentication token.
Tokens stored in those storages you mention can be read by any javascript code, even third party.
That doesn't happen with http-only cookies.
Be careful with what you recommend publicly, as others might end up assuming this is fine, when it is clearly not.
Re: SPAs Are Dead?
#14Cookies suck. The interface is beyond terrible, they were never scoped properly, and they don't have to be used. Browser storage (sessionStorage, localStorage) is perfectly valid for storing an authentication token.
Leaking your auth tokens through XSS sucks more.
Re: SPAs Are Dead?
#15Cookies suck. The interface is beyond terrible, they were never scoped properly, and they don't have to be used. Browser storage (sessionStorage, localStorage) is perfectly valid for storing an authentication token.
By interface you mean.. the HTTP protocol? At least they can be scoped on the domain level. Browser storage can't.
Re: SPAs Are Dead?
#16Earlier quoted context omitted.
Leaking your auth tokens through XSS sucks more.
I don’t know whether you are referring to only local and session storage being feasible or not, but on can access cookies from JS as well.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#re...
Re: SPAs Are Dead?
#17I prefer using cookies, but most SPAs actually use JWTs.
Re: SPAs Are Dead?
#18Cookies suck. The interface is beyond terrible, they were never scoped properly, and they don't have to be used. Browser storage (sessionStorage, localStorage) is perfectly valid for storing an authentication token.
Re: SPAs Are Dead?
#19Earlier quoted context omitted.
Leaking your auth tokens through XSS sucks more.
I don’t know whether you are referring to only local and session storage being feasible or not, but on can access cookies from JS as well.