Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As @Dave Ferguson mentioned, the easiest way, most coldfusiony way to share the session data is to keep it as a single application. You could even have the contents in a different folder, as long as the names are the same. </p> <p>You don't need to use a framework like FW\1 or anything like that to get what you're looking for, although they may make it a bit easier. You can always store structs inside the application scope, with the key being the the sub-application name. For example application.myvariable could be come application[request.subappname].myvariable. This keeps you with one application, but the application variables are scoped for the various sub-applications. You can do the same with your session variables too.</p> <p>Another approach, as @Brian mentioned, would use an intermediary store. You could then store your session data using any key you want. As @Dave Ferguson mentioned, set your CFID and CFTOKEN as domain cookies (CF10 in particular has some improvements in <a href="http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSe61e35da8d3185183e145c0d1353e31f559-7ffc.html" rel="nofollow">setting up the cookies</a>). That way the same CFID and CFTOKEN will be used across applications. They still have different sessions, but use the same session identifiers. You can then use that combination as the key to your data in the intermediary store.</p> <p>A database would be the conventional way to go about this, but depending on your app this may cause concurrency and locking issues, issues with serialization/deserialization, or performance, and then there's always handling the purging of old/expired data. So you might want to look into something like <a href="http://ehcache.org/" rel="nofollow">ehcache</a> or <a href="http://memcached.org/" rel="nofollow">memcached</a> to handle this.</p> <p>ehcache in particular is an attractive option, as it is bundled with ColdFusion 9+, can use both memory and disk, depending on your settings, the data in the cache can survive a service restart (or reboot), and it can be set to automatically expire records after a certain amount of inactivity. And yes, it can be <a href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSCAD9638E-2D2C-48d8-9069-AE5A220B75A6.html#WSd160b5fdf5100e8ff9be58612a1d7d628d-8000" rel="nofollow">used for custom caches</a>. </p> <p>I do advise that you be careful if you take this approach. You need to weigh the performance hit for grabbing the data from the cache each time (say in onRequestStart), vs the memory consumption by grabbing the data in onSessionStart() and holding duplicates across many applications, until the session(s) time out. Which route you go will depend totally on the performance characteristics of your application, size of your session data, etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload