Session and Flash persistence

Hi all,

I am getting an error where I don’t expect one… (aren’t they always like that?)

Testing Coldbox 3.5 from GIT development branch.

Starting a brand new project.
I am setting the following in my Coldbox.cfc configuration:

flashURLPersistScope = “client”

Next I remove session management (because we work in clustered environment) by setting in my Application.cfc:

I fwreinit the app.

Is there something else to do? Because when I try to run the site it throws me:

Application Execution ExceptionError Type: Expression : [N/A]

Error Messages: The requested scope session has not been enabled.
Before session variables can be used, the session state management system must be enabled using the cfapplication tag.

Yes Tom. That setting is now removed looks at the new flash config structure on the what’s new doc.

I’ve attached a custom flash scope you can use which will fix this for you. Once implemented, you will not be able to use the ColdBox Flash Scope, but, it removes the session requirement.

I had the same issue when I disabled sessions for a current site redesign.

Just register the CFC in your /config/ColdBox.cfc’s coldbox.flashURLPersistScope. Here is my config.

coldbox = {
… much removed …
,flashURLPersistScope = “model.coldbox.CustomFlashScope”

CustomFlashScope.cfc (1.52 KB)

Thanks Luis and Aaron for your replies,

No need for the custom flash scope, Aaron, but thanks anyway, it is a nice piece of code to study.

The directives found in the what’s new in 3.5 helped perfectly… I should have looked there first :wink:

In the configure function off Coldbox.cfc I added:

flash = {
scope = “client”,
properties = {}, // constructor properties for the flash scope implementation
inflateToRC = true, // automatically inflate flash data into the RC scope
inflateToPRC = false, // automatically inflate flash data into the PRC scope
autoPurge = true, // automatically purge flash data for you
autoSave = true // automatically save flash scopes at end of a request and on relocations.

And things work perfectly.

Cheers, thanks again.
Tom Van Schoor