This is a class/flow design question that I am trying to wrestle with:
I am trying to make a user's session information available across the application my Grails application without having (or requiring) to pass HttpSession around between service layer and controller.
Currently, I have a filter, where once a user logs in, all the User related information are mapped into a UserSessionHelper class and I add an instance of that class to session like:
session.userInfo = new UserSessionHelper(name:"x", isActive: true)
I want to be able to access the session object and it's contents everywhere in my application without explicitly passing it around (as parameter), in the same manner how grailsApplication is available throughout Grails.
Could someone give me some tips on how to accomplish this, in a thread-safe manner?
I am using Grails 2.4.2
Thanks.