title: Branch.io referral implementation not working in web app
body: <p>I am using branch SDK in the mobile app for which I am working on for more than 2 years now. I want to have the referral feature in our web application as well. I have followed the web app integration guidelines and has integrated branch in my app. I am using v2.54.2 of branch SDK and v16.13.1 of React.</p>
  <p>I am facing a strange issue after integrating. I am calling the <code>branch.logout()</code> method while the user logs out of the application. But after the user logs in back (either to the same user account or to a different user account in our application), none of the branch functionalities work. (<code>branch.setIdentity()</code>, <code>branch.credit()</code>, <code>branch.redeem()</code> etc.). I am getting the following error in the console</p>
  <pre><code>Uncaught Error: Invalid JSON string: [object Object]
      at ia (build.min.js?cd67:7)
      at d (build.min.js?cd67:57)
      at Mb (build.min.js?cd67:57)
      at eval (build.min.js?cd67:146)
      at eval (build.min.js?cd67:135)
      at k (build.min.js?cd67:66)
      at XMLHttpRequest.Sb.g.onreadystatechange (build.min.js?cd67:64)
  </code></pre>
  <p>I’m not even able to identify which method is causing this error. The branch APIs won’t work even if I do a hard reload. After days of debugging what I found is all the functionalities will work if I open the app in a new tab and close the current tab. But if the user logout and login from the new tab, the issue comes back.</p>
  <p>What I suspect is the global branch object, while logging out is not getting reset to the initial state. Can anyone please help me with this issue? I am stuck with this issue for more than 2 weeks now</p>