[ColdBox 3.8.1] Best way to use SessionStorage

69 views
Skip to first unread message

Chad Baloga

unread,
Feb 10, 2014, 9:39:45 AM2/10/14
to col...@googlegroups.com
We will be using SessionStorage to store some user data.  What is the best way and place to use this so we don't have to use getPlugin("SessionStorage") everywhere since it will be used in multiple views and layouts?

Sana Ullah

unread,
Feb 10, 2014, 9:48:46 AM2/10/14
to col...@googlegroups.com
Hi Chad,

You can define your own method in "Request Context Decorator" then that method will be available in handlers, views and layout.

Your custom method will be short version of any implementation like sessionStorage, clientStorage etc.

----
Sana

On Mon, Feb 10, 2014 at 2:39 PM, Chad Baloga <cba...@gmail.com> wrote:
We will be using SessionStorage to store some user data.  What is the best way and place to use this so we don't have to use getPlugin("SessionStorage") everywhere since it will be used in multiple views and layouts?

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Aaron

unread,
Feb 10, 2014, 10:50:25 AM2/10/14
to col...@googlegroups.com
i would put a method in your applicationhelper.cfm.

Jason Durham

unread,
Feb 10, 2014, 10:55:42 AM2/10/14
to col...@googlegroups.com
You could also simply load it into the RequestCollection using the "requestStartHandler" defined in your Coldbox configuration CFC.

Jason Durham


--

Andrew Scott

unread,
Feb 10, 2014, 6:45:25 PM2/10/14
to col...@googlegroups.com
Chad,

Personally, where ever you need it. So if you need it in a handler, or a service then have Wirebox inject it, this plugin can be a singleton reducing the memory footprint. So feel free to drop it any where you need it, doing int this way.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/

Reply all
Reply to author
Forward
0 new messages