Skip to content

Miscellaneous

enableSession()

enableSession() — returns any

Available in: controller, model, mapper, migrator, migration, tabledefinition

One-line session-auth wiring for config/services.cfm. The auth subsystem ships complete (Authenticator strategy registry + SessionStrategy with login/logout/currentUser and SID rotation) but wiring it by hand spans two files: map the singletons here, then register the strategy in app/events/onapplicationstart.cfm. enableSession() collapses that into one idempotent call: // config/services.cfm enableSession(sessionKey = “wheels.auth”); The DI container is available in services.cfm (it is NOT available in config/app.cfm — services.cfm is loaded after the container is built). Manual wiring keeps working; this helper is the convenience path.

NameTypeRequiredDefaultDescription
sessionKeystringnowheels.auth
onLoginanyno—
onLogoutanyno—