check this if it helps. Add Single Page Application to website portal page
This app is served as a www page from frappe framework. That makes it part of same domain served as static files so there is no issue with cors and requests can be made with cookie already there in browser for rest of the site.