In an app that I'm building, I run everything through a filter called authentication in the init() of Controller.cfc:
<cffunction name="init" hint="Provides filtering of admin authentication for all controllers that extend this one. NOTE: When overriding this method, be sure to call super.init(), or else you'll lose all authentication in your new controller.">
<!--- Make sure user is logged in unless they're in the process of logging in --->
<cfset filters(through="authenticate", except="login,signin,forgot,reset")>
<!--- Check to see if user needs to reset password before proceeding --->
<cfset filters(through="checkForPasswordReset", except="login,logout,signin,forgot,reset,password,changePassword")>
<!--- Only allow access to password reset functionality if settings allow it --->
<cfset filters(through="restrictReset", only="forgot,reset")>
</cffunction>
Here's what my authenticate() filter looks like in the same Controller.cfc file:
<cffunction name="authenticate" hint="FILTER: Makes sure a user session exists. If not, redirects to login.">
<!--- Make sure user is logged in --->
<cfif not isLoggedInAdmin()>
<cfset redirectTo(controller="main", action="login")>
<cfset loggedInAdminUser = false>
<!--- If user is logged in, set the properties the layout needs --->
<cfelse>
<cfset loggedInAdminUser = model('adminUser').findByKey(
session.adminUser.id)>
</cfif>
</cffunction>
As you can see, I'm using
session.adminUser.id to set a variable called loggedInAdminUser, which can basically be used anywhere.
There isn't any problem with accessing the session scope in your controller. In fact, the controller is theoretically the only place that should be accessing the session scope at all.
Hopefully this will give you a start.