I have a server running (example.io). If I am running my backend as well as frontend in example.io but with different ports, everything works. If I am using localhost for my frontend and running my backend on example.io, I get the warning message I set in the title, which I think it means cookies are not saved (I can't log in).

But why? Isn't same domain and different ports consider to be different and cross-site? What is the difference if I am using localhost? Why cookies are saved if I'm running both my frontend and backend with different ports in example.io, but not if I am running my frontend on localhost? Also, what can I do to fix this so I could save cookies on my localhost?

Thank you so much in advance.

I have my Access-Control-Allow-Origin set to my frontend host and port and Access-Control-Allow-Credentials set to true. I really have no idea why running my frontend on localhost doesn't save the cookies.

0

There are 0 best solutions below