Dependent and independent sessions

Hello, I have a problem with the handling of sessions in different applications and I need help.
I want to have several applications on my server, some use the same database and others do not, and I don’t want to lose sessions.
When there are 2 applications that use the same database I have no problems, I configure the session array with yii\web\DbSession. But when I want to log in to a third application that uses a different database I can’t keep all sessions open, if I log in to one application it closes the session in another.
Do you know how I can make this application that uses an independent database also have its session independent from the other applications?

Usually that’s done by OAuth and issuing tokens/cookies. Or by sharing sessions via something as shared Redis.