How to reload the page so the account doesn't automatically log out

I tried using location.reload() to reload the page when there is an error. It works fine on the web, but the account automatically logs out on the mobile android app. How can I not log out on mobile? when using reload() ?

I’ve never seen this issue before, but instead of using location.reload(), can you try using location.replace(window.location.href). This will reload the current page but without creating a new entry in the session history, which might help preserve the session.

Also, what errors are you getting on the mobile before logging out?