The easiest way is to persist it using flash RAM. This entry explains how to do it when redirecting:
http://www.quackfuzed.com/index.cfm/2008/6/10/ColdBox-Using-Persist
Here’s the docs on it:
http://wiki.coldbox.org/wiki/EventHandlers.cfm#setNextEvent
Also, you could get fancy and use the Flash RAM directly:
http://wiki.coldbox.org/wiki/FlashRAM.cfm
The biggest reason I don’t use the Flash RAM persistence with setNextEvent, is it clears out after it’s used and if the user hits the refresh button, the variable won’t be there any longer.
Also, feel free to use session storage as well. There’s a nice ColdBox plugin called SessionStorage that gives you a nice API to store and retrieve values:
http://wiki.coldbox.org/wiki/Plugins:SessionStorage.cfm
And for the record, at the end of the day there’s absolutely nothing keeping you from just directly accessing the good old session scope directly. The main issue there is you can’t mock it if you’re writing unit tests because it breaks encapsulation.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com