The easiest way is to persist it using flash RAM. This entry explains how to do it when redirecting:
Here’s the docs on it:
Also, you could get fancy and use the Flash RAM directly:
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:
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.
ColdBox Platform Evangelist
Ortus Solutions, Corp