Previously, the front-end pages and interfaces were accessed by ip addresses in the server directory. after the front-end pages were accessed by a domain name, there was no need for IP addresses to access the interface, or was there a problem of cross-origin and SESSION loss? How can this problem be solved? The front-end page and interface are in the same directory as the server.
All access using ip addresses
After that, the front-end page has a domain name and does not need an IP address to access the interface or use an IP address to access the interface.
Then there is a problem of cross-origin and SESSION loss?
How can this problem be solved?
Reply content:
The front-end page and interface are in the same directory as the server.
All access using ip addresses
After that, the front-end page has a domain name and does not need an IP address to access the interface or use an IP address to access the interface.
Then there is a problem of cross-origin and SESSION loss?
How can this problem be solved?
A simple and effective method is to configure a domain name for your interface
Of course, there are also methods to pass session IDs through URLs, but this method has poor compatibility.
Especially important !! Why does the interface need a Session !?
Generally, tokens are used for Interface Verification.
Of course, php has a session solution. it is about to get off work. I will talk about it tomorrow.