Built a chrome extension,connect to this extension via W3A and switch to different web it disconnects and how to keep to login?

How can I maintain the ‘connected = true’ status when switching to another site?

Hi Min! Thanks for reaching out. I can help with your question about maintaining the ‘connected = true’ status when switching between websites in your Chrome extension. Here’s what I gathered:

  • SDK Details: Plug n Play
  • Issue: Disconnecting when switching to a different website.

To address your issue, maintaining the connection status usually requires that your extension handles the session consistently across different sites. Here are some suggestions:

  1. Check Session Persistence: Ensure that your authentication tokens or session data are stored persistently and can be accessed across different pages. You might consider using Chrome’s storage API.

  2. Use Event Listeners: Implement event listeners to manage connection status changes and handle reconnections seamlessly.

If you’re still experiencing issues, could you please share the following for better assistance?

  • SDK Version Number
  • Platform (if applicable)
  • Code Snippets related to the Web3Auth initialization and login process

Feel free to include any relevant links or images that could help us understand your setup better. We’re here to help!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

I have set the session time to 7 days, which is the maximum limit for free usage. I checked the returned idToken and confirmed that the actual session time is indeed 7 days from the moment I chose to sign in.

For example, I am on X (Twitter) and logged in with X using my extension, and then I switch to another website, but the login status is lost; at this point, connected = false. My goal is to maintain the login status when I switch back and forth between different websites.