Navigating in and out between projects is always going to be difficult - even more so when you need ot maintain control over authentication status.
As you move from one project to another (let’s say A to B), a new session is created. The user still has a session open in Project A which will timeout based on the settings for the Project (these can be set within the Designer under the “Project” menu bar option).
What I recommend is logging the user out asynchronously:
def log_out_session(sessionId = self.session.props.id):
import system
system.perspective.logout(sessionId)
system.util.invokeAsynchronous(log_out_session)
# it is important to do the navigation LAST because the session will not execute any code AFTER the navigation
system.perspective.navigate(url=<destination>)