Hi Gildo, I’m a bit confused about what you are calling a session here, do you mean the transaction?
The logic is: any DB changes inside a transaction will get undone upon rollback, independent if there is one or more Yii2 components/models/etc involved.
As far as I understand, the session data won’t be written to the storage until it is explicitly closed by calling Session::close(), or, more likely, until it is implicitly closed when the application get terminated.
So, I think you can safely call Session::get() and Session::set() inside a db transaction block as long as you avoid closing the session.