I just switched over from using sessionStorage to using the flash for one of my modules, so that I could use other scopes if needed.
Anyway inside an interceptor I am seeing flash as a empty string, so the following
flash.put(“myKey”,“myvalue”);
Ends up throwing a method doesn’t exist type of error, if I dump the flash and abort the processing, I end up seeing an empty string.
According to the docs on FlashRam, the interceptor is supposed to have this available and the code seems to support this. However it is 100% empty for some reason.
Where in the application lifecycle are you trying to use Flash Ram? If you try too early, the request service isn’t initialized and the variable that holds the flash RAM object is still a “0”. See line 25 of RequestService.cfc. It’s not initialized until onConfigurationLoad() is called.
For the life of me I can’t remember where, but I ran into this somewhere else. We should probably put in a check or something in getFlashScope().
Hmm, preProcess should be fine. Can you provide a stack trace or some code?
The RequestService creates the flash scope on line 68 in its onConfigurationLoad method. It has to wait until then since the storage location is a setting.
No idea what RequestService you’re looking at Brad, but the flash is built when the application loader is run, where it then runs buildFlashScope which is not where you say it is.
Stack trace here would not help, if it is empty it is empty…
I’m not sure why you don’t think a stack trace would be useful. It’s important to determine where in the request/application lifecycle the flash scope is being accessed.
The version of ColdBox that comes with the latest ContentBox.
Because the first error is the flash error, and as it is an interceptor that is just setting to an empty string, I fail to see how the stack trace is going to show anything more.
As I said if I dump flash it is an empty string, so of course a method not found is going to occur. And the stack trace is not going to show anything more on that.