The battle of DI containers is that you can define your dependencies, and the container provides you with objects with all the dependencies (and their dependencies in turn, etc.). The more objects you place in the container, the higher the likelihood that you can use these objects together without calling βnewβ in one of the objects.
So - if the Sessions object for the User object and the Sessions for SiteStatistics is the same, then be sure to use only one container. If they are different, still use the same container, but when setting up dependencies, use different identifiers for each session object.
If you are looking for ways to isolate user session data from SiteStatistics data, I think the DI container is not suitable for this.
source share