Search code examples
reactjssessionsession-cookiessession-statevelo

Share session between ReactJS and WIX web application on different servers


I need to share session between two web applications on different servers. My main web application is developed on ReactJS and some eCommerce stuff is developed on WIX. So, how can I use same session for both domains. I read lot of blogs and stackoverflow questions but not get any authentic and secure way to do that. Both web applications are hosted on different servers and using main domain i.e "example.com" and sub-domain i.e "store.example.com".


Solution

  • If HTML iframe is used in WIX site then session will automatically share between main domain and sub-domain. What I did for this

    • Created a separate component for header in ReactJs application.
    • Use the URL of that component in WIX site as iframe.
    • Sessions automatically share between for domain and sub-domain by browser.