I have a fairly typical MVC application in PHP. Quite often I need to grab data from the session but I'm never sure if I should do this in the controller, or in the service.
For example, if a request hits domain.com/user/edit
, my controller could get the current user from the session and pass it to the service, or the service could access the session itself.
If I do it in the service it creates a dependency between the service layer and the session object. If I do it in the controller, it makes the controller a bit fatter.
I know it's only a small point but I have a lot of (small) variables stored in the session, and parameter handling for my requests is quite complex in itself.
Thanks!