RE: [coldbox:17884] [Coldbox 3.6] Recommended way to persist a single variable?

Hmm, you’re right-- we do seem to be missing examples. It’s pretty straight forward. In any handler, view, layout, etc you can access the plugin like so:
var sessionStorage = getPlugin(“sessionStorage”);
to inject the plugin into ANY CFC that WireBox creates, this will also do nicely:
component {
property name=“sessionStorage” inject=“coldbox:plugin:sessionStorage”;
}

Then using it is as simple as

sessionStorage.setVar(“user”,“Brad”);
if(sessionStorage.exists(“user”)) {
writeOutput(sessionStorage.getVar(“user”));
}
sessionStorage.deleteVar(“user”);

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com