background

Run the local console project through localhost. After opening the home page, the page is automatically refreshed, and no operation can be performed.

why

The default SameSite policy of Chrome 80 or later is Lax. In this policy, cookies cannot be carried when the current domain name sends cross-domain requests to third-party domain names. Therefore, the local management console sends requests without cookies, and the back-end interface fails to detect the user information carried in the request. The front-end page is constantly refreshed.

Solution:

1. Chrome earlier than version 91:

Open chrome://flags/#same-site-by-default-cookies, set it to disable, restart the browser and run the project.

2. Chrome version 91 and later :(solution 1 has been removed from chrome after version 91)

Windows: Open the Chrome shortcut properties, select Target, add –disable-features=SameSiteByDefaultCookies, close all browser Windows, restart the browser, and run the project.

For MAC: Run the open-a “Google Chrome” –args –disable-features=SameSiteByDefaultCookies command in Terminal to enable Chrome

3. Browsers of 94 or later versions

Chromium project website (www.chromium.org/updates/sam… It is mentioned that option 2 Settings will be removed after version 94, so that both option 1 and Option 2 solutions will be invalidated by then, and a proxy solution can be considered.