What authentication mechanism are you using? Logins against the Netbox local user database? As long as both Netbox's have the same SECRET_KEY in configuration.py, it should be fine.
The next time you get kicked out and prompted for a username/password, can you take a screenshot? Is there any error message shown?
Also look at your frontend webserver logs (Apache or Nginx) to check your theory that this is to do with switching over from one server to the other.
The token information are stored in the database
I don't understand what you mean by that. Tokens are used for API authentication, not for user logins to the web interface.