Using SessionStorage in a Model


I read this page
but I am having trouble getting it to actually work.

I have a model that I'm trying to access the sessionstorage in order
to populate the arguments for an init function of a component that the
model extends.

<cfcomponent displayName="top_ten_functions"

  <cfproperty name="SessionStorage"
type="coldbox:plugin:sessionstorage" scope="instance" />

    this.init( aid = instance.SessionStorage.getVar("aid") );


The code above continuously returns "Element SESSIONSTORAGE is
undefined in INSTANCE." ... if I try to dump instance before the init
line, it tells me that instance doesn't exist ... anyone have any
ideas what I'm doing wrong here?


Once coldbox injected every dependencies then it will call a method onDIcomplete. put your code inside the method then you will have the values.

coldbox.xml.cfm setting for model

this.init( aid = instance.SessionStorage.getVar("aid") );

Also I would suggest to read model integration guide once more.