4 ms·
How would one handle the situation of having to respond to (authenticated) requests from a web app running on both localhost and a domain-based website? I've b
by blauditore 7y ago
How would one handle the situation of having to respond to (authenticated) requests from a web app running on both localhost and a domain-based website?
I've been in this situation before with web-based cross-platform apps using Cordova. As far as I remember, I ended up echoing the origin domain if it matched a set of allowed domains (basically localhost and example.com), since regular expressions or lists are not supported in allowed-origin headers. For session tracking, I used tokens rather than cookies to avoid CSRF issues. Would there have been any better solution for this? I think not.