A Cypress test is
restricted to visiting a single domain - well almost. Cypress test runner reloads when it sees the second domain, which removes all previous local values - it is as if the browser reloaded the Cypress spec and continued from the current
cy.visit command. There is an old Cypress issue #944 about it with lots of anger and frustration. Don’t worry, Chris Breiding is working on the official solution in pull request #18075.
Even before this issue is fixed, there are ways around it. In the video below I show how to visit two different domains in two different tests and pass the information from one test to another one via the plugin file.