Home  >  Q&A  >  body text

Is there a way to pass data from one subdomain to another, opening two different tabs in react

I have the first subdomain, for example. a.xyz.com and try to pass the data to the second subdomain, eg. b.xyz.com is located under the domain e.g. xyz.com..

I've tried using local storage, session storage, and cookies, but can't get through. Is there a way to pass data from first subdomain to second subdomain My example uses React js

P粉143640496P粉143640496374 days ago608

reply all(1)I'll reply

  • P粉752479467

    P粉7524794672023-09-09 09:33:45

    You can try one of the following ways to pass data:

    <强>1. Query parameters: You can use query parameters in the URL to pass data between subdomains. For example, you can append data as part of the URL when navigating from a first subdomain to a second subdomain.

    <强>2. Shared backend/API: If the first and second subdomain share a common backend or API, you can store the data server-side and retrieve the data in the second subdomain by making a request to the server.

    reply
    0
  • Cancelreply